Re: undefined variable
Re: undefined variable
- Subject: Re: undefined variable
- From: Nigel Garvey <email@hidden>
- Date: Tue, 31 Jul 2001 23:23:03 +0100
Daniel McCoy wrote on Tue, 31 Jul 2001 11:59:49 -0400 (EDT):
>
thank you for you help. I am new to apple script.
>
>
i tested that code you gave me. but it still won't quit the program. maybe
>
i did something wrong. here is that i have.
>
>
tell application "Finder"
>
repeat with i from 1 to 6
>
if {the creator type of application process, i} is equal to
>
"AOp3" then
>
tell application "America Online" to quit
>
end if
>
end repeat
>
end tell
>
>
any i deas?
>
again. thanks for the deed back.
This might be what you want.
tell application "Finder"
application process "America Online" exists
end tell
if the result is true then -- (or: if result then)
tell application "America OnLine" to quit
end
The 'quit' line is outside the Finder 'tell' block, as people often find
that the Finder itself quits otherwise. If you want to check the app
using your creator type:
try
tell application "Finder"
set AOL to the name of the first process whose creator type is
"AOp3"
end tell
tell application AOL to quit
on error number -1728
-- Can't get name of non-existent process
-- so do nothing
end try
NG