Skip to content

Instantly share code, notes, and snippets.

@jonathanhle
Created October 13, 2023 15:31
Show Gist options
  • Save jonathanhle/21983fd17088a35eb9a09c211478613d to your computer and use it in GitHub Desktop.
Save jonathanhle/21983fd17088a35eb9a09c211478613d to your computer and use it in GitHub Desktop.
command line apple script osascript
osascript <<END
tell application "System Events"
delay 0.5
keystroke space using command down
delay 0.5
set textBuffer to "TextEdit"
repeat with i from 1 to count characters of textBuffer
keystroke (character i of textBuffer)
delay 0.05
end repeat
delay 0.5
keystroke return
delay 1
set textBuffer to "Hello world!"
repeat with i from 1 to count characters of textBuffer
keystroke (character i of textBuffer)
delay 0.05
end repeat
end tell
END
osascript <<END
tell application "System Events"
tell application "Managed Software Center" to activate
delay 0.25
keystroke "r" using command down
end tell
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment