Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

add icon to applescript application

Hi Normally I would do this by this by copying and pasting the icon from one to another, by selecting the application then cmd i select the icon in the window cmd c then repeat on the one I am coping it too by selecting cmd v


Now when they sync over Dropbox this does not get carried accross, how can I lock it into the application? I tried replacing applet.icns inside resources but although this changed I still don't have the correct icon.


I'm using Yosemite. should it make a difference.


Many Thanks

Matt

Mac Pro, OS X Yosemite (10.10.2)

Posted on May 21, 2015 1:18 AM

Reply
Question marked as Best reply

Posted on May 21, 2015 6:45 AM

In Yosemite's Script Editor, you must use New from Template ▸ Cocoa-AppleScript Applet menu item. On the Script Editor toolbar, there will be two icons near the right. Click on the rightmost to open the bundle info drawer. At the top of the Resources list will be applet.icns. Remove this, and drag/drop your new applet.icns to this topmost location. Close the bundle info drawer. Add your AppleScript, and save as an Application. The instant the new application is saved and appears in Finder — the new icon is visible. Attempting this without that Cocoa-AppleScript Applet menu item will not work.


On Mavericks, one can replace the applet.icns in the Resources folder of an ordinary AppleScript application, but it takes a reboot to make the new icon appear.

10 replies
Question marked as Best reply

May 21, 2015 6:45 AM in response to MattJayC

In Yosemite's Script Editor, you must use New from Template ▸ Cocoa-AppleScript Applet menu item. On the Script Editor toolbar, there will be two icons near the right. Click on the rightmost to open the bundle info drawer. At the top of the Resources list will be applet.icns. Remove this, and drag/drop your new applet.icns to this topmost location. Close the bundle info drawer. Add your AppleScript, and save as an Application. The instant the new application is saved and appears in Finder — the new icon is visible. Attempting this without that Cocoa-AppleScript Applet menu item will not work.


On Mavericks, one can replace the applet.icns in the Resources folder of an ordinary AppleScript application, but it takes a reboot to make the new icon appear.

May 21, 2015 9:46 AM in response to MattJayC

Sorry for the delay, had some investigating to do. Back on Yosemite 10.10.3.


I went out on the web and downloaded a 512x512x300dpi png image. Preview on Yosemite would allow me to convert this proper UI sized png to .icns. It refused to convert anything else that was not 512x512.


In Script Editor, I chose New from Template > Cocoa-AppleScript applet. Then, on the toolbar, I opened the script bundle panel, and replaced the default applet.icns with the .icns from Preview — renamed as applet.icns.


I wrote a one liner AppleScript, and saved this as test.app to the Desktop. The new icon was immediately present.


Optional


If you ever need the full retina icon set, you can generate it via /usr/bin/iconutil as follows:

mkdir folder.iconset

# use the .icns from Preview or other source here

/usr/bin/iconutil -c iconset -o folder.iconset applet.icns

ls folder.iconset

icon_128x128.png icon_128x128@2x.png icon_16x16.png icon_16x16@2x.png

icon_256x256.png icon_256x256@2x.png icon_32x32.png icon_32x32@2x.png

icon_512x512.png icon_512x512@2x.png

May 26, 2015 5:43 AM in response to VikingOSX

It took me a while to get this to work, following your instructions always help, I say that as I was trying to update ones that were already saved under that template. I found that the icns file needs to be added to the script before it gets saved down, after that I couldn't change the icns over, it would just be a blank icon.


Also I didn't realise in Preview that when you open a PNG file, you can select save as then in that screen hold the alt/option key and you then have other formats to save it as an ICNS file. before I was going a very long winded way about it.


If there is a way to change it afterwards that could be useful.


VikingOSX wrote:


As a footnote, I created a 512x510x300 dpi image, and Preview refused to export it as an icns file. As soon as I changed that 510 to 512, it worked.

I tried this and it just refuse either way? but not important.



Many Thanks for you help!

Matt

May 26, 2015 6:59 AM in response to MattJayC

I'm just experienting with a droplet that I made too a while ago


the script was made on snow lion and saved as a droplet, not using any templates


It starts

on openthese_items


I used the template of droplet with settable Properties.


I see that the icns file is labelled droplet.icns.


So following above it still defaults to the default icon.

What am I missing this time?

Thanks

add icon to applescript application

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.