• 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: on quit handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: on quit handler


  • Subject: Re: on quit handler
  • From: Axel Luttgens <email@hidden>
  • Date: Mon, 11 Apr 2011 09:28:40 +0200

Le 10 avr. 2011 à 19:38, louie a écrit :

> Hi Axel,
> What I have is a VOIP application that I start from a script. What I want is when I press command q while in the VOIP application I want to check to see if a recording application is running and terminate it.
> Thanks for any help

Hello Louie,

Thanks for the details.

So, let's assume the VOIP application is named "VOIP.app" and that the recording application is named "Recording.app".

Since you launch VOIP.app from a script, perhaps could you save it as a stay open application and try something along those lines:

	(*
	A skeleton for the launcher application.
	Supposed to be saved as a stay open.
	*)

	-- Start the VOIP application
	tell application "VOIP" to run

	-- Watch the VOIP application
	on idle
		-- If the VOIP application isn't running anymore, ask me to quit.
		if application "VOIP" is not running then quit
		-- Otherwise, ask for an idle event one second later.
		return 1
	end idle

	-- This "on quit" handler may be invoked:
	--    when one quits the launcher application,
	--    implicitly from the idle handler.
	on quit
		if application "VOIP" is running then tell application "VOIP" to quit
		if application "Recording" is running then tell application "Recording" to quit
		-- Allow the quit event to be passed further.
		continue quit
	end quit


HTH,
Axel

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >on quit handler (From: louie <email@hidden>)
 >Re: on quit handler (From: Axel Luttgens <email@hidden>)
 >Re: on quit handler (From: louie <email@hidden>)

  • Prev by Date: Re: on quit handler
  • Next by Date: [ANN] TagMinder 1.0.3 update
  • Previous by thread: Re: on quit handler
  • Next by thread: [ANN] TagMinder
  • Index(es):
    • Date
    • Thread