Re: Find whether Safari is active or not
Re: Find whether Safari is active or not
- Subject: Re: Find whether Safari is active or not
- From: Joe <email@hidden>
- Date: Thu, 16 Jul 2009 09:03:37 -0700
At 5:11 AM -0600 7/16/09, Sutapalli Satyanarayana wrote:
>I am struck with simple script.
>I am opening Safari on Leapord using script as following:
>
>tell application "Safari"
>activate
>--open some url
>end tell
>
>Its working fine. But the problem is that if Safari is already opened and showing some webpage, its over writing in same window/tab of Safari.
>What I want is that if Safari is already running, I want to create a new tab and open url in that. If Safari is not running, I just want to launch it and open the URL in first window (not in a new tab).
Something along this line should work.
tell application "Safari"
if exists window 1 then
make new tab at end of tabs of window 1 with properties {URL:theURL}
else
open location theURL
end if
end tell
HTH
Joe
_______________________________________________
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