Skip to content

Instantly share code, notes, and snippets.

@DeathBorn
Created July 21, 2019 19:48
Show Gist options
  • Select an option

  • Save DeathBorn/c0b96a4cf908f039f8a85950847b879f to your computer and use it in GitHub Desktop.

Select an option

Save DeathBorn/c0b96a4cf908f039f8a85950847b879f to your computer and use it in GitHub Desktop.

Revisions

  1. DeathBorn created this gist Jul 21, 2019.
    79 changes: 79 additions & 0 deletions apple script
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,79 @@
    repeat 10 times
    tell application "Safari"
    activate
    delay 0.4
    tell application "System Events" to set frontApp to name of first process whose frontmost is true
    tell application "System Events"
    tell application process frontApp
    set _selection to value of attribute "AXFocusedUIElement"
    tell _selection to perform action "AXShowMenu"
    tell application "System Events" to key code 125
    tell application "System Events" to keystroke return
    end tell
    end tell
    end tell

    tell application "TextEdit"
    activate
    delay 0.4
    tell application "System Events" to keystroke "v" using command down
    tell application "System Events" to keystroke " |||| "
    end tell

    tell application "Safari"
    activate
    delay 0.4
    tell application "System Events" to set frontApp to name of first process whose frontmost is true
    tell application "System Events"
    tell application process frontApp
    set _selection to value of attribute "AXFocusedUIElement"
    tell _selection to perform action "AXShowMenu"
    tell application "System Events" to key code 125
    tell application "System Events" to key code 125
    tell application "System Events" to keystroke return
    end tell
    end tell
    end tell

    tell application "TextEdit"
    activate
    delay 0.4
    tell application "System Events" to keystroke "v" using command down
    tell application "System Events" to keystroke " ||||"
    end tell


    tell application "Safari"
    activate
    delay 0.4
    tell application "System Events" to set frontApp to name of first process whose frontmost is true
    tell application "System Events"
    tell application process frontApp
    set _selection to value of attribute "AXFocusedUIElement"
    tell _selection to perform action "AXShowMenu"
    tell application "System Events" to key code 125
    tell application "System Events" to key code 125
    tell application "System Events" to key code 125
    tell application "System Events" to keystroke return
    end tell
    end tell
    end tell

    tell application "TextEdit"
    activate
    delay 0.4
    tell application "System Events" to keystroke "v" using command down
    tell application "System Events" to keystroke "||||"
    tell application "System Events" to keystroke return
    end tell

    tell application "Safari"
    activate
    delay 0.4

    tell application "System Events" to key code 125

    end tell


    end repeat