• 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
undefined variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

undefined variable


  • Subject: undefined variable
  • From: <email@hidden>
  • Date: Mon, 30 Jul 2001 17:25:44 -0400

hello all,

i am trying to write an apple script to check to see if a certain program
is running. if it is running, then the script quits the apllication and
deletes it. if the application is on the hard drive and isn't running. it
deletes it. and, if the program isn't on the hard drive, or running, then
it just quits. i have everything working, but trying to get applescript
to check to see if the application is active or running. i run into an
undefined variable.

tell application "Finder"
activate
if exists folder "appfolder" of startup disk then
if "app" is active then # THIS IS WHERE I GET THE ERROR#
tell application "Finder"
activate
end tell
quit application "app"
else
tell application "app"
activate
quit application "app"
end tell
end if
end if
tell application "Finder"
activate
if exists folder "appfolder" of startup disk then
select folder "appfolder" of startup disk
delete selection
empty trash
else
quit application "Script Editor"
end if
end tell
end tell


  • Follow-Ups:
    • Re: undefined variable
      • From: Steven Angier <email@hidden>
    • Re: undefined variable
      • From: Matthew Smith <email@hidden>
  • Prev by Date: Re: Script crashes Script Editor; Scripter launch locks up 9.1 Mac solidly
  • Next by Date: Re: creator codes
  • Previous by thread: Re: running a script from a script ?
  • Next by thread: Re: undefined variable
  • Index(es):
    • Date
    • Thread