• 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: keystroke "esc"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keystroke "esc"


  • Subject: Re: keystroke "esc"
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 03 Feb 2013 20:59:53 -0600

On Feb 03, 2013, at 17:48, Shane Stanley <email@hidden> wrote:
If you want to force quit, you might as well dispense with the dialog:

tell application "System Events"
set thePid to unix id of process "Mail"
end tell
do shell script "kill " & thePid
______________________________________________________________________

Hey Folks,

You can avoid the call to System Events (might as well if you're going to call a shell-script anyway).

Mountain Lion:

 do shell script "pgrep Mail"

 do shell script "kill `pgrep Mail`"

 do shell script "pkill Mail"

Non-Mountain Lion:

 kill `ps -o pid,comm -xc | awk '/Mail/ { print $1 }'`

--
Chris

 _______________________________________________
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: keystroke "esc"
      • From: Shane Stanley <email@hidden>
References: 
 >Re: keystroke "esc" (From: Nigel Garvey <email@hidden>)
 >Re: keystroke "esc" (From: Christopher Stone <email@hidden>)
 >Re: keystroke "esc" (From: Shane Stanley <email@hidden>)

  • Prev by Date: Fix this script
  • Next by Date: Re: Fix this script
  • Previous by thread: Re: keystroke "esc"
  • Next by thread: Re: keystroke "esc"
  • Index(es):
    • Date
    • Thread