• 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: Waiting for Godot
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Waiting for Godot


  • Subject: Re: Waiting for Godot
  • From: Matthew Smith <email@hidden>
  • Date: Wed, 12 Dec 2001 16:20:44 +1100

on 12/12/2001 15:29, Ricardo J. Seijo at email@hidden wrote:

> I apologize if this is a FAQ, but the archives don't seem very
> searchable. How do I tell a script to sit tight and wait until a specific
> application has been closed before resuming its actions? I want it to make
> a set of changes and launch an application, then wait until the user closes
> said application to reverse the original changes. Thanks in advance!

You need to set the script applet so it stays open. You then create an idle
handler which will check to see if the application in question is still
running. When it is not it will then do your work.

on run
-- do initial stuff
launch myApp
end run

on idle
tell app "Finder"
set procList to every application process
set appFound to false
repeat with x in procList
if name of x = "my apps's name" then set appFound to true
end repeat
end tell
if appFound then
-- do post stuff
tell me to quit
end if
return 60 -- don't do anything for 60 seconds
end idle

on quit
continue quit
end quit
--
Matthew Smith


References: 
 >Waiting for Godot (From: "Ricardo J. Seijo" <email@hidden>)

  • Prev by Date: Re: Waiting for Godot
  • Next by Date: changing the color of superscript text in Quark
  • Previous by thread: Waiting for Godot
  • Next by thread: Re: Waiting for Godot
  • Index(es):
    • Date
    • Thread