Skip to content

Instantly share code, notes, and snippets.

@pjrobertson
Created April 25, 2012 10:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pjrobertson/2488903 to your computer and use it in GitHub Desktop.
Save pjrobertson/2488903 to your computer and use it in GitHub Desktop.
Toggle Keyboard Viewer for OS X
tell application "System Events"
if exists (process "Keyboard Viewer") then
click (process "Keyboard Viewer"'s window 1's buttons whose subrole is "AXCloseButton")
else
do shell script "/usr/local/bin/keyboardViewer"
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment