isapprunning: returns >0 if app is running; 0 if not

version information:


isapprunning v. 1.0 by duus (Jul 23, 2008)
location: http://thedu.us/scripts/isapprunning/isapprunning
isapprunning, returns >0 if app is running; 0 if not, v 0.1, by duus

type <isapprunning help> for more information
or open source code with a text editor and read it:
http://thedu.us/scripts/isapprunning/isapprunning/

help information:


isapprunning script by duus
from:
How to Determine if a Certain App Is Running Using AppleScript and Perl
http://daringfireball.net/2006/10/how_to_tell_if_an_app_is_running

isapprunning <APPNAME> will return 0 if APPNAME is not running, >0 otherwise.
isapprunning exact <APPNAME> will restrict to exact name match

_examples of use_
$ isapprunning Mail
1
$ isapprunning mai
2
$ isapprunning mail.app
0
$ quit mail
quit mail
$ isapprunning Mail
0
$ isapprunning mai
1

(download script)

to install:

  1. copy script into a folder on your path.
  2. type chmod +x isapprunning.sh to make it executable


a duusscript... This page updated: Wed Aug 6 11:30:55 EDT 2008, when duus was feeling sleepy.