Created
October 22, 2013 16:22
-
-
Save fractaledmind/7103658 to your computer and use it in GitHub Desktop.
This script uses a simple utility called "checkModifierKeys", which can be found here: http://macscripter.net/viewtopic.php?pid=114479#p114479, to determine whether or not one of the modifier keys is being pressed. This proves very helpful for adding deeper functionality to your Applescripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (* CHECK MODIFIER KEYS | |
| REQUIREMENTS: | |
| - the checkModifierKeys utility, which needs to be in your Utilities folder. To download, visit here: http://macscripter.net/viewtopic.php?pid=114479#p114479 | |
| *) | |
| set buttonOptions to {"cmd", "option", "control", "shift", "capslock"} | |
| set p2u to POSIX path of (path to utilities folder) | |
| set res to do shell script p2u & "checkModifierKeys " & item 4 of buttonOptions | |
| if res = "0" then return false | |
| if res = "1" then return true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment