Re: Script expects quoted text mystery
Re: Script expects quoted text mystery
- Subject: Re: Script expects quoted text mystery
- From: Gary Lists <email@hidden>
- Date: Wed, 14 Jan 2004 23:13:52 -0500
Gnarlodious wrote [01-14-04 10:22 PM]:
>
Why is it when I say:
>
>
tell application "iCab" to OpenURL "http://www.gnarlodious.com/"
>
>
it works fine,
As it should, of course. The important phrase is 'application "iCab",
which is not just a simple string of stuff, as it might appear.
>
but when I say:
>
>
tell application defaultBrowser to OpenURL "http://www.gnarlodious.com/"
>
>
it won't even compile?
Even if you set the variable defaultBrowser to "application \"iCab\"" you
won't have any luck, because that phrase is not resolving to an application
process. (I don't know the technical jargon.)
You need to use one of two methods, depending on what you want to tell iCab.
Standard Suite stuff will likely work with some alternative methods, but I
think you'll want to gain access to the whole dictionary, so you need a more
robust method of loading the dictionary.
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.)
You can try the double-tell if you'd like, but I don't think it is as robust
(it may very well be, however.) I'll let you google for that one. ;)
>
I wonder if this is related to the question I asked yesterday:
I don't think so.
>
set the file type of file FileSpec to "TEXT"
>
set the creator type of FileSpec to "R*ch"
>
>
Maybe someone can explain why a variable doesn't work here.
>
>
>
Very strange.
No, not at all. The variable just doesn't have the same value as
'application "xxxx"', even if its string value looks like it.
>
--Gnarlie [Dude]
--
Gary
-- whose mother must have perfected the 'double tell'...
_______________________________________________
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.