• 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: Quitting current application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quitting current application


  • Subject: Re: Quitting current application
  • From: Steve Mills <email@hidden>
  • Date: Fri, 14 Oct 2016 13:15:32 -0500

On Oct 14, 2016, at 12:41:51, -dan d. <email@hidden> wrote:
>
> I have been trying without success to do a scrippt which will send:
>
> keystroke "q" using command down
>
> To quit the current open application I'm in.
>
> How can this be done regardless of which application it is?

Why not just tell the app to "quit"? It's a standard verb.

tell application "System Events"
	set frontApp to item 1 of (application file of every application process whose frontmost is true)
end tell

tell application frontApp
	quit
end tell

--
Steve Mills
Drummer, Mac geek


 _______________________________________________
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: 
 >Quitting current application (From: "-dan d." <email@hidden>)

  • Prev by Date: Quitting current application
  • Next by Date: Re: Quitting current application
  • Previous by thread: Quitting current application
  • Next by thread: Re: Quitting current application
  • Index(es):
    • Date
    • Thread