Re: Script expects quoted text mystery
Re: Script expects quoted text mystery
- Subject: Re: Script expects quoted text mystery
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 14 Jan 2004 21:31:21 -0800
On 1/14/04 8:13 PM, "Gary Lists" <email@hidden> wrote:
>
You can try this method (making X-adjustments as needed):
>
>
set creaType to "iCAB"
>
tell app "Finder" to set myApp to the first process whose ,
>
creator type is (creaType as <<class type>>) as <<class psn >>
>
tell myApp
>
-- now you're cooking with gas
>
end tell
>
>
This is the most reliable that I have found (and use.)
Look, 9 is fine but this isn't 9, it's 7.6. It's the historical method that
John Delacour first found. It was first superseded by Emmanuel's method
outlined in Smile Help, which is much easier to use, where you get the
application path to the file:
set creaType to "iCAB"
tell app "Finder" to set myAppPath to application file id creaType as string
tell application myAppPath
-- you still have to use <<raw codes>> for everything, as above
end tell
That still works in X (use Unicode text instead of string for best results.)
It can be done in Smile using "Copy Translate" to get the raw codes, or in
Script Debugger where the raw codes are available with a flip of a popup in
the app's dictionary. But it's still a big bother getting all those raw
codes.
Best of all is using the 'using t5erms from' method devised by the great
AppleScript team about 4 years ago already, when OS 9.0 came out - or just
before, while 8.6 was still current. (I'll go check the AppleScript
Sourcebook in a minute.) It even works in older OS's although you need that
version (either AS 1.5.5 or 1.4.3, I've forgotten) to compile it yourself.
set creaType to "iCAB"
tell app "Finder" to set myAppPath to application file id creaType as string
using terms from application "iCab"
tell application myAppPath
-- now you're flying: use normal iCab terms, no raw codes needed
end tell
using terms
It's really great, it's 100% reliable, it's easy - and it was invented for
OS 9! And works in X! (And the scripts made with it even work in 8!)
--
Paul Berkowitz
_______________________________________________
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.