Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > AppleScript 'tell'

AppleScript 'tell'
Thread Tools
Addicted to MacNN
Join Date: Jan 2000
Location: Stoneham, MA, USA
Status: Offline
Reply With Quote
Feb 9, 2003, 02:49 PM
 
Is there a way to check if an application is open before you start talking to it, so if it is not open, your script will do something else instead of launching the app?
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Feb 9, 2003, 03:29 PM
 
Originally posted by l008com:
Is there a way to check if an application is open before you start talking to it, so if it is not open, your script will do something else instead of launching the app?
Yes.

Under Mac OS X, 'System Events' keeks a track of open apps. The Finder does the same under presious OS versions:

Code:
tell application "System Events" -- or Finder under 9.x set runningApps to name of every process if runningApps contains "Some App" display dialog " Some App is already running" else display dialog "Nope." end if end tell
Clearly, you change the "Some App" check with the name of the app in question.
Gods don't kill people - people with Gods kill people.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:46 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2