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 19:55:08 -0800
On 1/14/04 7:22 PM, "Gnarlodious" <email@hidden> wrote:
>
Why is it when I say:
>
>
tell application "iCab" to OpenURL "http://www.gnarlodious.com/"
>
>
it works fine, but when I say:
>
>
tell application defaultBrowser to OpenURL "http://www.gnarlodious.com/"
>
>
it won't even compile?
Because the term 'OpenURL' is defined by the application "iCab". (You could
use 'open location' and it would work, since 'open location' is a built-in
scripting addition available inside or outside application blocks.)
If there's some reason why you need a variable (could there be more than one
application which might be calling 'OpenURL'? Or perhaps there might be more
than one copy or one version of iCab on the computer and you're going to be
specifying which via a full path to the correct application? That's a good
reason.) then you can compile it this way:
set defaultBrowserPath to "disk:folder:whatever"
using terms from application "iCab"
tell application defaultBrowserPath to OpenURL
"
http://www.gnarlodious.com/"
end using terms from
But don't expect this to work with a browser that doesn't have the same
'OpenURL' command - or rather a command that uses the same raw code as
iCab's OpenURL command. It won't. If you really want it to open in the
default browser, then simply do:
open location "
http://www.gnarlodious.com/"
That's precisely what 'open location' is designed to do.
>
>
>
I wonder if this is related to the question I asked yesterday:
>
>
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.
--
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.