Skip to content

Instantly share code, notes, and snippets.

@HR
Created May 16, 2016 16:15
Show Gist options
  • Save HR/e18519ddc8f8a4ca56df22328086b985 to your computer and use it in GitHub Desktop.
Save HR/e18519ddc8f8a4ca56df22328086b985 to your computer and use it in GitHub Desktop.
Select Menubar Item Applescript (for GUI)
on run argv
set procName to (item 1 of argv)
set menuItem to (item 2 of argv)
ignoring application responses
tell application "System Events" to tell process procName
tell menu bar item 1 of menu bar 1
click
end tell
end tell
end ignoring
do shell script "killall System\\ Events"
delay 0.1
tell application "System Events" to tell process procName
tell menu bar item 1 of menu bar 1
click menu item menuItem of menu 1
end tell
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment