Configure MS Office 2011 Spell Check Language

jleomcdo
Contributor

I’m looking for a way to automate/script the setting of MS Office 2011 language that is used for Spelling and Grammar checking.

Preferably, this would be an Apple script.

As part of our “localization” process, I need to configure MS Office apps to use the local language.

Any help would be greatly appreciated.

Here is what I’ve tried…
/usr/libexec/PlistBuddy -c “Add 14SpellingLid integer 1033" ~/Library/Preferences/com.apple.HIToolbox.plist

The real problem here is the “backslash’s” that is required. The Key in the plist is named “14SpellingLid"
Passing a "" in applescript (with a Do Shell Script command) is something that I have not mastered!! :(

We are on OS X 10.9.2 and JSS 9.31

3 REPLIES 3

talkingmoose
Moderator
Moderator

Not sure if this is the answer you're needing but a backslash is a special character and special characters must be escaped by, well, a backslash.

For example, if I were to write the path to a file in Terminal I'd either need to use a backslash to escape the spaces:

/Users/mmoose/Documents/Microsoft User Data

or I'd need to include the path in quotes:

"/Users/mmoose/Documents/Microsoft User Data"

Because the backslash is a special character just like a space, you'd need to escape it with another backslash:

“Add 14\Spelling\Lid integer 1033"

talkingmoose
Moderator
Moderator

I suggest reading my response online. The email is stripping out the additional backslash in my example.

jleomcdo
Contributor

I did finally get my "Do shell script" command to work with Apple Script
do shell script ("/usr/libexec/PlistBuddy -c " & "'" & "Add 14" & "" & "" & "Spelling" & "" & "" & "Lid integer " & spellingID & "'" & " ~/Library/Preferences/com.microsoft.office.plist")
*spellingID is a varable.

I'm just not sure if there is another plist file that I should write to. After I change the Spelling ID in the ~/Library/Preferences/com.microsoft.office.plist file, it doesn't seem to change Word or Excel to use that language for spell checking.
I know that if I open Word and change the Language and set as default, then quit Word, that this plist file is updated with a different number. (i.e. 1033 is English US and 2057 is English UK)