Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- While `keystroke text_to_write` also works, it types so fast some characters get mixed up.
- --- For example, `keytroke "Example"` might result in `EXample` as if AppleScript wasn’t fast enough to release ⇧ after the `E`.
- --- By using a `repeat` loop, we ensure each character gets typed in isolation.
- set text_to_write to "{{whatever you want}}"
- tell application "System Events"
- repeat with c from 1 to count characters of text_to_write
- keystroke (character c of text_to_write)
- end repeat
- end tell
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement