NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(NSKeyDownMask, handler)įor mouse input, simply replace NSKeyDownMask with the relevant mask from the list available here: :įor example, NSMouseMovedMask works for tracking mouse movements.įrom there, you can access event.locationInWindow() or other attributes. All you have to do is press record, perform the actions, press stop (edit if needed), and press play whenever you need. Pulovers Macro Creator is a Free Automation Tool and Script Generator. #!/usr/bin/python2.6ĭef applicationDidFinishLaunching_(self, aNotification): Macro Recorder Quite like a tape recorder, the application captures keystrokes and mouse movement to automate many actions. The only caveat is that you have to use Python2.6 as 2.7 doesn't seem to have the objc modules available. I also found a brief but working (As of Mountain Lion) example of how to globally log key strokes. I ran across a few solutions to this problem today and figured I'd circle back around and share here so others could save the search time.Ī nifty cross platform solution for simulating keyboard and mouse input:
0 Comments
Leave a Reply. |