Re: Safari Scripting Help (Newbie stuff) Complete!
Re: Safari Scripting Help (Newbie stuff) Complete!
- Subject: Re: Safari Scripting Help (Newbie stuff) Complete!
- From: Michelle Steiner <email@hidden>
- Date: Fri, 28 Dec 2007 14:35:18 -0700
On Dec 28, 2007, at 2:23 PM, Mark J. Reed wrote:
Yeah, that was what I thought. But - and I realize we're down to
aesthetics at this point - why duplicate the "tell front document"
block?
tell application "Safari"
activate
try
set _exists to document 1
on error
make new document
end
tell front document to set URL to "http://www.macscripter.net/"
end
Why have the try block?
tell application "Safari"
activate
if not (document 1 exists) then tell (make new document) to set URL
to "http://www.macscripter.net/"
end tell
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
-- Michelle
--
Windows Vista: Viruses, Intrusions, Spyware, Trojans, and Adware.
_______________________________________________
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