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: Dennis Cox <email@hidden>
- Date: Thu, 16 Jul 2009 06:18:41 -0500
- Thread-topic: Find whether Safari is active or not
On 7/16/09 6:11 AM, "Sutapalli Satyanarayana" <email@hidden> 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).
>
> Looking for some help here.
>
> --Satyam.
>
Take a look at this:
tell application "System Events"
if exists process "Safari" then
display dialog "Safari is running."
else
display dialog "Not running."
end if
end tell
Dennis Cox
_______________________________________________
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