Converting to .icns

I could use a recommendation on how to convert .png to .icns.

I sometimes change script icons by simply doing a get info and pasting a .png file into the script icon. That adds the .png to the bundle and does change the icon. However, SD loses it when doing a Save as, so I suppose I need to go the .icns rough as recommended by the SD7 bundle feature.

Thanks.

A little googling turned up these references.

From our own Phil Stokes:

And another:

Mark, your google skills are better than mine. Unfortunately, Phil’s download link no longer works. I looked at some very manual ways to do it.

In the end, I decided to get iConvert Icons from the Mac app store. Very straight-forward with a good interface. $5.

Oh, and now I can see an icon file does correctly stick with a Save As in SD7. The png-paste method wouldn’t even survived a standard save.

Looks like SD6 does this as well.

Poking around, I see that a pasted icon is not retained within the script’s bundle. I knew how this worked years ago and I’ve forgotten. Anyway, for applets, its best to have your own .icns or .asset representation. This is the most robust solution and will survive editing and transmission.

If it’s anything like the method used for folders, 10.13 brings another glitch: @koenigyvan discovered a bug in the Finder where its update command removes custom icons.

Revisiting this, if I simply replace the .icns file in an applet bundle with a .icns file (with images created followith the instructions linked to above) will that replace the icon for the applet and enhanced applet?

(Didn’t there used to be an icon editor included with MacOSX? Or am I remembering back to Mac OS9?)

  • Open your applet and show the Resources tab.
  • Drag your .icns file into the Resources area at the bottom.
  • Select the new name in the Applet Icon menu.
  • Save.

You can delete the old icon if you prefer — it doesn’t really matter.

Probably the latter. But the App Store is full of them, or you can use a script to create them from any image.

Thanks, I just named it applet.icns and replaced what was there. I’ll use that instead.

I’ve got a bunch of apps that could benefit from a custom icon, so I think I’ll write a script that will do create the icns file.

Can we use a similar method to change the icons displayed in apple’s dialogs?

That’s not a good idea — you should use your own name.

The dialogs will use whatever you declare as the app’s icon.

Is it possible use custom dialog icons within Script Debugger, and from scripts in the Apple scripts menu?

You can using display dialog, or Dialog Toolkit Plus.

So I’ve changed the icons on several SD apps to custom icns files, and it seems to be working just fine, until this morning.

One of the apps icons has switched to a generic application Icon (not the applet Icon.

Also, I’m wondering if I set a custom icon for an app in SD, and then open, change and save the app in Script Editor, will it remember the custom Icon? (That didn’t happen in this case, but I’m wondering).

(Also, since this is no longer have anything to do with Beta Testing, should we carry this on in the AppleScript topic?)

I opened the app that was displaying the generic app Icon and something strange had happened.

The icns file was named “TVGrid” and was still in place in the resources. (verified in Finder).

But, Applet Icon menu had “TVGrid-1” selected. There is no “TVGrid-1” icns file, of course, so that’s why I got the generic icon.

When I selected the menu the “TVGrid” was an option and I selected it, and closed and saved in SD, then ran the applet and the correct icon displayed.

So the question is where did “TVGrid-1” come from?

Probably not — but you tell me.

I’ve been meaning to suggest that.

No idea. Yell (here) if it happens again.

I use Converter365 png to icns online converter for this purpose and I had no problems ever. Sometimes renaming the file just doesn’t work for me.