Custom Finder icons

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.

  1. Save your script as an application bundle.
  2. Right click on your application and choose “Show Package Contents”
  3. Rename your custom icon as “applet.icns”
  4. In the “Resources” folder replace the current “applet.icns” file with your custom icon of the same name.
  5. Relaunch “Finder”

Your icon should now stay.