More PlistBuddy localization help requested
Ok I have read through the two recent threads on modifying the ~/Library/Preferences/ByHost/com.apple.HIToolbox.$UUID.plist and ran into some issues on the non-roman localizations. First off thanks to the other posters and sharing their work!
It turns out that the roman languages are fairly simple to configure the com.apple.HIToolbox.$UUID.plist for. But what we need to do is edit this preference file to provide the exact same options in the Input menu that users would see if they configured the system for Japanese, Korean, Chinese Traditional & Chinese Simplified. These localizations show multiple input methods in the menu and this is what I'm having a hard time getting PlistBuddy to replicate.
Here are the desired xml entries that I want.
[code]
AppleEnabledInputSources
InputSourceKind
Keyboard Layout
KeyboardLayout ID
0
KeyboardLayout Name
U.S.
Bundle ID
com.apple.inputmethod.Kotoeri
Input Mode
com.apple.inputmethod.Japanese
InputSourceKind
Input Mode
Bundle ID
com.apple.inputmethod.Kotoeri
Input Mode
com.apple.inputmethod.Japanese.placename
InputSourceKind
Input Mode
Four additional dict entries removed to shorten the post but I will need to configure those as well.
[/code]
The syntax I put together based on the previous threads looks like this.
[code]
/usr/libexec/PlistBuddy -c "Add AppleEnabledInputSources:1 dict " /Users/user/Library/Preferences/ByHost/com.apple.HIToolbox.$UUID.plist
/usr/libexec/PlistBuddy -c "Add AppleEnabledInputSources:1:\"Bundle ID\" string com.apple.inputmethod.Kotoeri" /Users/user/Library/Preferences/ByHost/com.apple.HIToolbox.$UUID.plist
/usr/libexec/PlistBuddy -c "Add AppleEnabledInputSources:1:\"Input Mode\" string com.apple.inputmethod.Japanese" /Users/user/Library/Preferences/ByHost/com.apple.HIToolbox.$UUID.plist
/usr/libexec/PlistBuddy -c "Add AppleEnabledInputSources:1:\"InputSourceKind\" string Input Mode" /Users/user/Library/Preferences/ByHost/com.apple.HIToolbox.$UUID.plist
/usr/libexec/PlistBuddy -c "Add AppleEnabledInputSources:2 dict " /Users/user/Library/Preferences/ByHost/com.apple.HIToolbox.$UUID.plist
/usr/libexec/PlistBuddy -c "Add AppleEnabledInputSources:2:\"Bundle ID\" string com.apple.inputmethod.Kotoeri" /Users/user/Library/Preferences/ByHost/com.apple.HIToolbox.$UUID.plist
/usr/libexec/PlistBuddy -c "Add AppleEnabledInputSources:2:\"Input Mode\" string com.apple.inputmethod.Japanese.placename" /Users/user/Library/Preferences/ByHost/com.apple.HIToolbox.$UUID.plist
/usr/libexec/PlistBuddy -c "Add AppleEnabledInputSources:2:\"InputSourceKind\" string Input Mode" /Users/user/Library/Preferences/ByHost/com.apple.HIToolbox.$UUID.plist
[/code]
This code mostly works however I get some extra keys that include the index number that I don't want and suspect keep this from working.
[code]
AppleEnabledInputSources
1
Bundle ID
com.apple.inputmethod.Kotoeri
Input Mode
com.apple.inputmethod.Japanese
InputSourceKind
Input Mode
2
Bundle ID
com.apple.inputmethod.Kotoeri
Input Mode
com.apple.inputmethod.Japanese.placename
InputSourceKind
Input Mode
3
[/code]
If anybody has some PlistBuddy syntax suggestions I suspect that's my problem with editing this file.
Thanks,
blake
Previous threads for reference..
https://www.afp548.com/forum/viewtopic.php?showtopic=22278
https://www.afp548.com/forum/viewtopic.php?showtopic=22427