• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Find whether Safari is active or not
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Find whether Safari is active or not (From: "Sutapalli Satyanarayana" <email@hidden>)

  • Prev by Date: Find whether Safari is active or not
  • Next by Date: Re: Find whether Safari is active or not
  • Previous by thread: Find whether Safari is active or not
  • Next by thread: Re: Find whether Safari is active or not
  • Index(es):
    • Date
    • Thread