• 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: Active application - how to tell? One more
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Active application - how to tell? One more


  • Subject: Re: Active application - how to tell? One more
  • From: John Stewart <email@hidden>
  • Date: Tue, 22 Jun 2004 17:55:12 -0400

On 06/22/04 at -0400 Graff said this

>You just have to keep polling it to see if it has stopped running.
>This is best done with an idle handler if you are using an applet but
>you can also just use a loop and a delay:
>
>----
>tell application "System Events"
> repeat while ((name of processes) contains "Tex-Edit Plus")
> delay 5
> end repeat
>end tell
>
>display dialog "it closed"
>----
>
>This will check every 5 seconds to see if the process "Tex-Edit Plus"
>has stopped running.


Why not as a stay open app with an idle handler

on idle{}
set appname to "nameofyourappgoeshere"
tell application "System Events"
if (name of every process) does not contain appname then
display dialog appname -- just for testing
-- your code goes here
end if
end tell
return 5
end idle

Just change "nameofyourappgoeshere" to the name of your application process as it's returned by
System Events.

JBS
--
42.7 percent of all statistics are made up on the spot.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Active application - how to tell? One more (From: Graff <email@hidden>)

  • Prev by Date: Re: copy full filepath name
  • Next by Date: Re: quit the dock - possible?
  • Previous by thread: Re: Active application - how to tell? One more
  • Next by thread: Re: Active application - how to tell? One more
  • Index(es):
    • Date
    • Thread