Script to add keyboard layout and set it as default

Kirill
New Contributor II

Hi,

Our company is located in Estonia and on pre-stage enrolment in region setting we choose Estonia. This sets only Estonian keyboard layout, but our main corporate language is English. Can somebody help me with a script to add English keyboard layout and set it as default?

Thank you in advance.

2 REPLIES 2

JRM5513
New Contributor III

Unless you know how to use PlistBuddy, I set the English keyboard on a Mac, copy its com.apple.HIToolbox.plist and deploy it on an other computer (in the user Library/Preferences folder).

uskeyboard.png

 

Kirill
New Contributor II

I'm trying this script but doesn't work for some reason

# adds the additional input source to the list of input sources
/usr/bin/defaults write com.apple.HIToolbox AppleEnabledInputSources -array-add '
<dict><key>InputSourceKind</key><string>Keyboard Layout</string><key>KeyboardLayout ID</key><integer>0</integer><key>KeyboardLayout Name</key><string>U.S.</string></dict>'

# enables the input menu in the menu bar
/usr/bin/defaults write com.apple.TextInputMenu visible -bool true

exit 0