• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: undefined variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: set variable to pict file contents? Set file icon to variable
  • Next by Date: Re: Re: undefined variable
  • Previous by thread: Re: undefined variable
  • Next by thread: Re: Re: undefined variable
  • Index(es):
    • Date
    • Thread