• 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: Sierra kills ASObjC Runner
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sierra kills ASObjC Runner


  • Subject: Re: Sierra kills ASObjC Runner
  • From: Shane Stanley <email@hidden>
  • Date: Fri, 23 Sep 2016 15:44:57 +1000

On 23 Sep. 2016, at 12:05 pm, Robert Poland <email@hidden> wrote:

The intent is to catch a key down.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use framework "AppKit"
use scripting additions

set optionDown to my checkModifier:"option"
set shiftKeyDown to my checkModifier:"shift"
set commandKeyDown to my checkModifier:"command"
set controlKeyDown to my checkModifier:"control"
if commandKeyDown and optionKeyDown and controlKeyDown then
--
end if

on checkModifier:keyName
if keyName = "option" then
set theMask to current application's NSAlternateKeyMask as integer
else if keyName = "control" then
set theMask to current application's NSControlKeyMask as integer
else if keyName = "command" then
set theMask to current application's NSCommandKeyMask as integer
else if keyName = "shift" then
set theMask to current application's NSShiftKeyMask as integer
else
return false
end if
set theFlag to current application's NSEvent's modifierFlags() as integer
return (((theFlag div theMask) mod 2) = 1)
end checkModifier:

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
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: Sierra kills ASObjC Runner
      • From: Robert Poland <email@hidden>
References: 
 >Sierra kills ASObjC Runner (From: Robert Poland <email@hidden>)
 >Re: Sierra kills ASObjC Runner (From: James Yanchak <email@hidden>)
 >Re: Sierra kills ASObjC Runner (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Sierra kills ASObjC Runner
  • Next by Date: Re: Localization problem.
  • Previous by thread: Re: Sierra kills ASObjC Runner
  • Next by thread: Re: Sierra kills ASObjC Runner
  • Index(es):
    • Date
    • Thread