• 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: "Stockly, Ed" <email@hidden>
  • Date: Fri, 14 Oct 2016 19:16:06 +0000
  • Thread-topic: Quitting current application

Here's how to do this the way you asked.

But sending appleEvents directly to the application or via system events
is better.

Either way, if you have unsaved documents open in that app, you'll get a
dialog asking if you want to save first.

ES

------------
(I'm using "w" here so I don't quit my script editor! Replace with "q"
when you're ready.

tell application "System Events"
 set frontApp to application process 1 whose frontmost is true
 tell application frontApp
  keystroke "w" using command down
 end tell
end tell









On 10/14/16, 10:41 AM,
"applescript-users-bounces+ed.stockly=email@hidden on
behalf of -dan d."
<applescript-users-bounces+ed.stockly=email@hidden on
behalf of email@hidden> wrote:

>
>Hello,
>
>I'm a fairly new scripter.
>
>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?
>
>Thanks.
>XB
> _______________________________________________
>Do not post admin requests to the list. They will be ignored.
>AppleScript-Users mailing list      (email@hidden)
>Help/Unsubscribe/Update your Subscription:
>imes.com
>Archives: http://lists.apple.com/archives/applescript-users
>
>This email sent to email@hidden


 _______________________________________________
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


  • Follow-Ups:
    • Re: Quitting current application
      • From: "-dan d." <email@hidden>
References: 
 >Quitting current application (From: "-dan d." <email@hidden>)

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