2

i create a little app using Script Editor and exported to .app file. now im trying to change the icon to a custom .icns file. the icns file was converted from a png using this website. also tried using this website.

after copying the icns to Contents/Resources/applet.icns and modifying the below lines of the Info.plist:

<key>CFBundleIconFile</key>
<string>applet</string>

also tried Contents/Resources/customFilename.icns and Contents/Resources/customFilename:

<key>CFBundleIconFile</key>
<string>customFilename</string>

the .app icon doesnt change. im sure the files are in .icns format. how can i debug and figure out why the .app isnt taking the .icns's?

App made in Applescript Icon wont change

2 Answers 2

4

No image conversion was necessary. In Finder.app, just (control + click) on the file that you want to change its icon, and choose the "Get info" command. Next, just drag your icon file from Finder, directly onto the actual icon image in the get info window you previously opened... Then you're good to go

enter image description here

2
  • yeah i feel pretty stupid. thanks for your help. maybe you can help with this? apple.stackexchange.com/questions/325206/…
    – lily
    Commented May 13, 2018 at 7:06
  • I tried a few different solutions, and this is the only one that worked for me.
    – Matt
    Commented Dec 20, 2022 at 19:02
0

The solution provided by wch1zpink seems to work well, but it does not change the icon stored inside the bundle. Already zipping and unzipping the bundle or copying to a smb-share reverts the icon to its standard as it is defined in info.plist. (Strangely, copying it via vnc to another machine does not affect the icon)

Therefore i suppose, that the icon-change is stored in some DS_Store-file or Spotlight Database: as long as Apple has full control over it, it keeps the icon; as soon as you leave the apple-universe the icon change is lost. If you want to deploy the script with the modified icon this is not recommended.

I recommend to overwrite the icon file. Rename your customized icns file, so that it has the same name as the one already within the app-bundle, then replace it.

Note: if you use Automator to create your apps, it will overwrite the icon every time you save it, therefore keep a backup of your custom-icns.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .