Re: Safari Scripting Help (Newbie stuff) Complete!
Re: Safari Scripting Help (Newbie stuff) Complete!
- Subject: Re: Safari Scripting Help (Newbie stuff) Complete!
- From: "Mark J. Reed" <email@hidden>
- Date: Fri, 28 Dec 2007 16:40:03 -0500
On Dec 28, 2007 4:35 PM, Michelle Steiner <email@hidden> wrote:
> Why have the try block?
Well, because Peter did. I am away from my references and couldn't be
sure that 'exists' would work. :)
> tell application "Safari"
> activate
> if not (document 1 exists) then tell (make new document) to set URL
> to "http://www.macscripter.net/"
> end tell
If document 1 does exist, that doesn't do anything; presumably the OP
would like to set its URL in that case.
> Or if you want to keep whatever is in an existing document, and not
> replace it with the new URL:
>
> tell application "Safari"
> activate
> tell (make new document) to set URL to "http://www.macscripter.net/"
> end tell
So does (make new document) open a new window or a new tab? I know
you can do the latter explicitly with (make new tab)...
--
Mark J. Reed <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden