Re: Newbie scripting question
Re: Newbie scripting question
- Subject: Re: Newbie scripting question
- From: Gary Lists <email@hidden>
- Date: Mon, 12 Jan 2004 22:45:10 -0500
Charles wrote [01-12-04 8:49 PM]:
>
I'm attempting to script for the first time (I just
>
switched). I'm getting an error 10818 (?) when
>
attempting to run the following code (please don't
>
laugh)
>
>
aunch application "Microsoft Entourage"
>
property target_URL : "http://www.cbsnews.com"
>
property target1_URL : "http://www.hotmail.com"
>
property target2_URL : "http://www.mail.yahoo.com"
>
open location target2_URL
>
open location target1_URL
>
open location target_URL
>
>
Any help would be appreciated!
Okay, first off, you might be telling the wrong application. Did you mean to
tell a web browser to do this or did you really want to tell Entourage?
tell application "Interenet Explorer" to open location "
http://google.com"
will actually compile (OMM, IE 5.1.7) to :
tell application "Internet Explorer" to GetURL "
http://google.com"
so that's all okay. You've got the right set of commands.
(Even though I think the 'open location' is a SA command, and IE uses
something like 'open url' or something. Check the Standard Additions
dictionary and the dictionary for your browser.)
You don't need to use properties unless you want the value to persist across
executions of the script (I mean, to remain as the value of the variable
even when the script is re-opened.)
You can do all of that more easily like this (using your property/variable
names):
tell application "Internet Explorer"
GetURL target_URL
GetURL target1_URL
GetURL target2_URL
end tell
Now, depending on your browser settings, the window may or may not be
re-used. In my settings for IE, new windows open for each, so I don't have
to create new windows before the next "GetURL" command (or else the window
URL would be replaced with the next one, and so on.)
Since your browser may not be IE, YCMV.
--
Gary
_______________________________________________
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.