Programmatically enter text into any application

試著忘記壹切 提交于 2019-12-24 02:35:09
问题 Is there a proof-of-concept Objective-C executable that enters some text into an application and then clicks the mouse, using Apple events and not AppleScript? e.g. the AppleScript equivalent of tell application "System Events" tell process "Safari" keystroke "Hello World" click end tell end tell It should work on Mac OS X 10.9, preferably be future oriented (backwards compatibility doesn't matter). The context is that I will be calling the Objective-C code from another language. I'm saying