Created
August 31, 2011 20:33
-
-
Save sdsykes/1184640 to your computer and use it in GitHub Desktop.
scriptingbridge sending keystroke with control key
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
def four_char_code(s) | |
(s[0].ord << 24) + (s[1].ord << 16) + (s[2].ord << 8) + s[3].ord | |
end | |
system = SBApplication.applicationWithBundleIdentifier("com.apple.SystemEvents") | |
system.send(:"keystroke:using:", space_number.to_s, four_char_code('Kctl')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment