Re: Quitting current application
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