• 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: Robert Poland <email@hidden>
  • Date: Fri, 23 Sep 2016 07:40:10 -0600
  • Z-usanet-msgid: XID787uiwNOL0400X31

Thanks Shane,

Not being a master AppleScript programmer, I don't understand the function of "on checkModifier:keyName"

Consequently I am not able to get a usable output.

> On Sep 22, 2016, at 11:44:PM, Shane Stanley <email@hidden> wrote:
>
> 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>

Robert Poland
Fort Collins, CO


 _______________________________________________
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: Yvan KOENIG <email@hidden>
    • Re: Sierra kills ASObjC Runner
      • From: Shane Stanley <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>)
 >Re: Sierra kills ASObjC Runner (From: Shane Stanley <email@hidden>)

  • Prev by Date: Sierra and URLByDeletingLastPathComponent
  • Next by Date: Re: Sierra and URLByDeletingLastPathComponent
  • Previous by thread: Re: Sierra kills ASObjC Runner
  • Next by thread: Re: Sierra kills ASObjC Runner
  • Index(es):
    • Date
    • Thread