Hi Bryan, I've done this in the past using quick and dirty NSApplescript: def
applescript_exec(script_string)
pnt = Pointer.new_with_type("@") as = NSAppleScript.alloc.initWithSource(script_string) as.executeAndReturnError(pnt) end script_string = %{ tell application "System Events" keystroke "h" using shift down end tell } applescript_exec(script_string) # results in 'H' You can send special keystrokes using this method also, see https://discussions.apple.com/thread/660394?start=0&tstart=0 I think that the 'proper' way would be the Quartz method, but I've never delved into that: http://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html#//apple_ref/c/func/CGEventCreateKeyboardEvent fb
|
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel