Last active
November 1, 2021 12:14
-
-
Save sidkang/3869f1c70b695ac2e6ede2d363911058 to your computer and use it in GitHub Desktop.
change IME using AppleScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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