I recently saw that some apps create a custom folder in the /Documents folder which has the app’s logo on the folder icon, eg GarageBand, Pages, BBEdit. I thought that would be pretty cool, and tried to do the same for my app, following these instructions:
However, when I follow the example, increase my app’s version number, build it and use it to create a custom folder on the desktop, while it does create a folder, it does not have the custom icon, just the usual default folder icon. Below is a screenshot of the settings I have tried in the FileType set. I have also tried setting the Type to File and Role to View or Edit without success.
In a Finder window looking at the desktop, the custom folder icon is displayed – the icon is just not displayed on the desktop directly. Now I just have to work out why my folder icon isn’t transparent around the edges…
A couple of interesting findings that may hopefully help someone else troubleshoot who is trying to do the same as me:
I rebooted my computer – not sure if that made any difference or not – and my test folder on the desktop still displayed the default folder icon until I right clicked on it and selected “Get Info”, and then it changed into my custom icon. So there must be some caching or something going on until it is forced to refresh.
When I loaded my .ico file into the FileType set, it seems to have lost its mask, which is why it is not transparent around the edges, so I’ll need to figure out what happened there.
There’s a bug in the IDE right now concerning loading ico files on macOS. I suggest opening it in Preview and saving either as icns or as individual pngs.
I opened up my Xojo 2021r2 IDE, opened my FileType group and dragged the icns onto the icon field. It was accepted, however when I clicked on the icon field to expand it, I could see that the images were not properly formatted (the mask was a black square and for some reason the transparent parts of the image were black, not white)
So I tried dragging the icns onto the expanded icon window → crashed the IDE. I have reported a Feedback bug (#65654)
The workaround I have cobbled together, which works for me is this:
Duplicated my png and renamed it to mask.png. Used Preview tools to create a mask (instant alpha, invert selection, adjust colour settings)