• 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 20:24:07 +0000
  • Thread-topic: Quitting current application

Hmmm, both should work. What is happening instead?







On 10/14/16, 1:19 PM, "-dan d." <email@hidden> wrote:

>
>Thanks Ed,
>
>That worked exactly as desired.
>
>Thanks to Steve also, I couldn't get his version to work.
>
>On Fri, 14 Oct 2016, Stockly, Ed wrote:
>
>> 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:
>>>
>>>at
>>> imes.com
>>> Archives: http://lists.apple.com/archives/applescript-users
>>>
>>> This email sent to email@hidden
>>
>>
>
>XB


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

  • Prev by Date: Re: Quitting current application
  • Next by Date: About path to temporary items.
  • Previous by thread: Re: Quitting current application
  • Next by thread: About path to temporary items.
  • Index(es):
    • Date
    • Thread