How to add an icon to your script....

Pretty much… they can get into it so far as they can see the names of file, but if you try opening the included script with Script Editor or any other tool you can’t access view/edit/change the code.

Go head and make a quick “hello world” script and try saving it out as run-only you’ll see =)

Ok thanks I’ll give it a go.

Same here…I’ll let you know how it goes guys…thanks! :slight_smile:

What does description.rtfd file in the bundle droplet do? I assume it’s where developer notes can be placed where I can put my notes in?

Okay this doesn’t work…even though I deleted the original script icon, and put my own .icns file, it still displays the old script icon??

Place the script on your desktop and Option (key) drag it to your hard disk - then open your hard disk.

Tom

Operating System: Mac OS X (10.4)

Come again? Option key drag my icon to the bundle contents folder in my script? Im not sure I understand?

Option (key) drag the bundle to hard disk.

Did you rename your custom icon? It must have the same name as the default you removed - “applet.icns” (without the quotes).

Okay, I’m not getting it:

  1. I place the script (saved as an application bundle with my icons file in the bundle and I’ve deleted the old icon).
  2. I press option key and drag my application bundle (script) to the hard disk.

No changes!

Please Help!

Did you in fact name your icon to applet.icns?

Is it in the same location as the old one?

Ben:

Sorry about all this; I have not messed with it in a few years, when I was running Tiger. I will try to work on it some more today, but it does not seem to be as simple as I recall.


display dialog "" & return & return buttons {"Cancel", "OK"} default button 2 with title "Title" with icon (path to resource "applet.icns" in bundle (path to me))

Save as an app bundle and the default script app icon should show in the dialog. If you want a custom icon for both app and dialog, substitute a suitable alternate .icns file for applet.icns in the Resources folder of the bundle package… using the same name.

The description.rtfd will show when a user opens the ‘About MyApp’ in the app name’s menu.

Note that any time you save a new version of your app using ‘Save As…’, you must replace the custom icon… and other modified resources (if any), in the new app.

Peter B.

(B. for Beelzebub)


Ben:

OK, I have tested the technique with both a stay open application and a droplet, it works just fine as discussed here. Drop the .icns file into your bundle, delete the original .icns file, rename the new .icns file (to whatever the old name was), re-save, and the icon magically changes to your custom icon.

I have also tried it with so called “Mac OSX icon” files, but no worky. They do need to be real .icns files.

Keep at it.

Thank God it works! :slight_smile:

For some reason, my “About” selection is grayed out and I populated the description.rftd file with some text. Why doesn’t it show?

Keep at it.

Peter B.

(AKA Idle Hands)


Could that be an odd permissions issue??

Does this mean you can only add 1 icon?