Re: Detecting Applescript and SKYPE
Re: Detecting Applescript and SKYPE
- Subject: Re: Detecting Applescript and SKYPE
- From: Luther Fuller <email@hidden>
- Date: Sat, 11 Oct 2008 14:23:16 -0500
On Oct 10, 2008, at 8:04 PM, Sander Tekelenburg wrote:
You can get the displayed name directly:
displayed name of (application file id applIdent)
I forgot all about that silly thing. Thanks.
On second thought and after a good night's sleep, I realized that
using the (displayed) name of an application is a bad idea. My
isRunning handler will work correctly most of the time, but it's easy
to fool. In other words, not idiot proof. (I'll spare you the details
of my experiments.)
Here is a better handler ...
on isRunning(applIdent)
tell application "System Events"
try
exists (some process whose bundle identifier is applIdent)
on error
return false
end try
return true
end tell
end isRunning
If the process does not exist, there is a longer than usual delay, but
not outrageous. The possible "bug" is that you should be able ask ...
tell application "System Events" to exists process identifier applIdent
but you can't. I've tried.
_______________________________________________
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