If i paste to my script custom Finder icon, it reverts back to default icon by itself when i run it. What causes this?
Assuming you mean an icon you’ve pasted into the Get Info window of a script application, I don’t know. Mine stays. If you mean an XCode application, you should ask there.
Indeed, if it’s built with Xcode, it may be replaced during the build process. If this is the case, you should be using a real .icns file and adding it to your project.
If you’re using plain AppleScript, Here’s what you need to do.
- Save your script as an application bundle.
- Right click on your application and choose “Show Package Contents”
- Rename your custom icon as “applet.icns”
- In the “Resources” folder replace the current “applet.icns” file with your custom icon of the same name.
- Relaunch “Finder”
Your icon should now stay.