IMESwitcher is a small utility on macOS that allows users to switch input methods using command-line instructions. It can be used in conjunction with Mac Built-in Automator and Keyboard shortcuts to achieve the functionality of quickly switching to a specified input method using a keyboard shortcut.
The operating system macOS 10.15.7 and 13.4 have been tested.
If you want to switch to a non-ABC IME input method using Automator, it is recommended to include the following steps in your script:
- First, switch to the ABC IME input method
- Then add a 0.1-second sleep delay
- Finally, switch to the desired target input method
git clone https://github.com/wox080xow/IMESwitcher.git
cd IMESwitcher
make
IMESwitcher <InputSource> <KeyboardLayout>
Here is the example through appending ~/.zshrc
and sourcing the file.
cat << EOF >> ~/.zshrc
# IMESwitcher
IS_HOME="/path/to/IMESwitcher"
export PATH="\$IS_HOME:\$PATH"
EOF
source ~/.zshrc
IMESwitcher com.apple.inputmethod.TCIM.Zhuyin com.apple.keylayout.ZhuyinBopomofo
IMESwitcher net.fhl.inputmethod.TaigiHakkaIME com.apple.keylayout.ABC
IMESwitcher com.apple.keylayout.ABC com.apple.keylayout.ABC
- InputSourceSelector
- Thanks for the help of ChatGPT.