Re: No way to tell if an application is running without launching it?
Re: No way to tell if an application is running without launching it?
- Subject: Re: No way to tell if an application is running without launching it?
- From: Johnny AppleScript <email@hidden>
- Date: Tue, 05 Oct 2004 17:46:39 -0600
Title: Re: No way to tell if an application is running without launching it?
This has always worked for me in any form:
set {t, apl} to {false, "Virex 7.2"}
tell application "System Events" to if exists process apl then set t to true
ignoring application responses -- avoid 'connection invalid' errors
if t is true then tell application apl to quit
end ignoring
Adapted for you, this should work:
set {t, p, apl} to {false, "Distiller", "Acrobat Distiller 6.0.2"}
tell application "System Events" to if exists process p then set t to true
ignoring application responses -- avoid 'connection invalid' errors
if t is true then tell application apl to quit
end ignoring
HTH — JA
On 04/10/05 6:12 AM, "Bill Planey" <email@hidden> wrote:
> I have a script that checks if an application is running, then quits it if
> it finds that it _is_ running. The problem is - the mere fact that
> applescript checks for this application process is enough to launch it (and
> then, of course, the script quits it). Just the act of checking seems to be
> enough to launch it if it isn't running at the time?
>
> Here is the code:
>
> tell application "System Events"
> try
> set the process_flag to (exists process "Distiller")
> end try
> end tell
> if process_flag then
> tell application "Acrobat Distiller 6.0.2" to quit
> end if
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden