Yes, so we aren’t expecting a custom icon to display on the .scptd. The .scptd lives on git, and then we run a deployment script that exports it as a code-signed, run-only, .app.
So I make a .scptd, go to the resources sidebar in Script Debugger, drag a custom icon from Finder into the Resources Folder for the .scptd in Script Debugger, and select that icon in the drop-down in Script Debugger.
Then when I deploy as a .app, the .app has the custom icon and everything’s great.
But then sometimes, when I next open the .scptd off git, make some changes to the code, and deploy, I notice the deployed copy no longer has the custom icon. This happens frequently.
So I open the .scptd, take a look. The icon file still shows inside the resources folder in Script Debugger, and it’s still set on the dropdown. But if I try to open that .icns file, it won’t open… if I drag the original back to in from Finder and choose “replace,” then it’s fine again. I can re-deploy and the icon’s back. But I have to do this all the time - more often than not with our applications that have custom icons, when I come back to them, the icons file doesn’t work anymore.
The .zip I uploaded of the example script with a corrupted icon - it’s weird, I just decompressed it here, double-clicked, and it opened right up in Script Debugger.
If I go to Finder and look inside the bundle at the .icns file for a corrupted one, the file size is exactly the same as the original, but Spotlight won’t preview it, and if I double-click to open, Preview tells me:
“The file “cleartemp.icns” could not be opened. It may be damaged or use a file format that Preview doesn’t recognize.”
So I suspect something about git/Script Debugger - I was hoping when you heard this, it would ring a bell with whatever was happening where Script Debugger thought our code was corrupt when we switched branches, that maybe it was a similar thing with the .icns file, but apparently not.
I ran a text diff on the non-functioning and a functioning copy of the same .icns files and it reports the contents are identical… so it must be something metadata related? I’m scratching my head.