Re: Icon on Alert window
Re: Icon on Alert window
- Subject: Re: Icon on Alert window
- From: Walter Ian Kaye <email@hidden>
- Date: Sun, 4 Jul 2004 05:22:22 -0700
At 03:05p +0200 07/03/2004, Federico didst inscribe upon an electronic papyrus:
Walter Ian Kaye <email@hidden> ha scritto:
> Note also that in place of a B&W 'ICON' resource, you may use a color
> 'cicn' resource instead. Make sure it's 32x32. Don't leave the
> default id of 128; I like to use an id in the 300 range (330 is my
> arbitrary preference) to avoid conflicts.
I've tried to use a custom icon and it seems to work in an unreliable
way, on my machine at least (10.3.4). Or I'm missing something
important.
I saved a compiled data fork script, a compiled resource fork script
(with Script Debugger) and an application, with this line:
display dialog "Hello" with icon 330
Then I've added a 'cicn' resource with an ID of 330 to all of them, but
when run, they give different results:
- The icon in the compiled script (data fork) is shown only when the
script is run within Script Debugger (or when SD is the target of a tell
block wrapping the 'display dialog' line).
Well I did say that it needs to be a resource fork script. It just so
happens that SD is written by a smart guy, and thus goes beyond the
call of duty. :-)
- The icon in the complied script (resource fork) is shown only when the
script is run within SD, or when the script is run from the system wide
Script Menu. It is not shown when the script is run from any other
application, or if the 'display dialog' line is wrapped in a tell block
targeting any app except for SD (well, any... I've tried only Finder,
iTunes, Script Editor 2, Smile and System Events).
Hmm. Could be that those apps have trouble managing the resource chain?
Either that, or Apple broke something in the Resource Manager.
Or simply that they pull the 'scpt' resource out and close the
resource fork without looking for any other resources. It is an easy
thing to overlook.
Send bug reports... ;)
- The icon in the application is shown only when the target of the
'display dialog' line is either SD or the application itself.
If an application, it's keeping its own resource fork open.
Also, a question: is it possible to add a custom icon to a "script
bundle" or an "application bundle"? I guess that one should add the icon
(in .icns file format?) in the Resource folder of the bundle. But then,
how can one refer to the icon? By file name?
I don't know, but what I would try is to make a data-fork resource
file with the 'cicn', and refer to it by ID. The Resource Manager is
supposed to know how to handle data-fork resource files. I don't know
what filename to give the .rsrc file, though. Maybe Apple's
documentation would say?
HTH,
-Walter
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.