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.

Revisions

  1. jonathanhle created this gist Oct 13, 2023.
    33 changes: 33 additions & 0 deletions command line apple script osascript
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    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