Re: Detecting Applescript and SKYPE - MORE
Re: Detecting Applescript and SKYPE - MORE
- Subject: Re: Detecting Applescript and SKYPE - MORE
- From: Luther Fuller <email@hidden>
- Date: Fri, 10 Oct 2008 16:37:46 -0500
On Oct 10, 2008, at 3:09 PM, Don Wieland wrote:
On Oct 10, 2008, at 11:33 AM, Luther Fuller wrote:
tell application "Finder"
exists application file id "com.skype.skype"
end tell
My original script only detects installation, not whether the it's
running. There is now a running property, but I couldn't get it to
work. A little more experimenting produced this handler, which does
work ...
on isRunning(applIdent)
tell application "Finder"
try
set AppName to name of (application file id applIdent)
on error
return false
end try
if AppName ends with ".app" then
set AppName to text 1 thru -5 of AppName
end if
return exists application process AppName
end tell
end isRunning
If you want to know if Chess is installed and running, just use ...
my isRunning("com.apple.Chess")
Why did I use "com.apple.Chess" when I could have simply used ...
exists application process "Chess"
?
Because some idiot may have changed the name visible in the Finder.
Make a copy of the Chess application (it will be named "Chess 2"),
launch it, then run the handler above to see how it works.
_______________________________________________
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