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: Nigel Smith <email@hidden>
- Date: Tue, 05 Oct 2004 17:14:55 +0100
On 5/10/04 13:12, "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?
Are you sure that is what is happening?
Distiller will launch when you try to *compile* the script, and if you save
it as a script document rather than an application it will have to be
recompiled each time you open it -- that will launch Distiller.
(Some apps, especially Adobe's do this. It was explained once -- something
about dynamic scripting capabilities which can only be determined by
launching the app, I think...)
Anyway, this will do what you want if you save it as an *application*:
tell application "System Events"
if exists process "Distiller" then
tell application "Acrobat Distiller 6.0.1" to quit
end if
end tell
HTH,
Nigel
_______________________________________________
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