Warning: Undefined array key "p" in /home/clients/a70cbb4a74edf8105da5fd7e142fb9de/web/forum/includes/vb5/template.php(404) : eval()'d code on line 794
Warning: Undefined array key "p" in /home/clients/a70cbb4a74edf8105da5fd7e142fb9de/web/forum/includes/vb5/template.php(404) : eval()'d code on line 794
Event Type: Multiple Keystrokes -
OSCulator Forum
If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
It would be great if a message could generate a long string of text as if it came from the keyboard. ie: I press a key on a midi controller and "Hello world" appears in a specific/frontmost application (just like Key Combo and Key Code do now).
I recently discovered this is something you can do easily with AppleScript.
In OSCulator, open the Parameters window and go to the AppleScript tab.
Create a new script and write this code:
Code:
tell application "System Events"
keystroke "abcdef"
end tell
You can even write code like this to ensure the application you want to send you keystrokes to is foremost:
Code:
tell application "TextEdit"
activate
end tell
tell application "System Events"
keystroke "abcdef"
end tell
Best,
Cam
Update: You need to create an empty document in TextEdit in order to test this code. If leave TextEdit with the initial Open dialog, this won't work.
Comment