Skip to content

Instantly share code, notes, and snippets.

@sidkang
Last active Nov 1, 2021
Embed
What would you like to do?
change IME using AppleScript
launch application "System Events"
delay 0.1
ignoring application responses
tell application "System Events" to tell process "TextInputMenuAgent"
click menu bar item 1 of menu bar 2
end tell
end ignoring
do shell script "killall 'System Events'"
delay 0.1
tell application "System Events"
tell process "TextInputMenuAgent"
tell menu bar item 1 of menu bar 2
click menu item "ABC" of menu 1
delay 0.1
end tell
end tell
end tell
ignoring application responses
tell application "System Events" to tell process "TextInputMenuAgent"
click menu bar item 1 of menu bar 2
end tell
end ignoring
do shell script "killall 'System Events'"
delay 0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment