Manage hyphenation exceptions in “All languages” language via scripting
How do I delete all words added to the “All languages” language in the User Dictionary dialog that were merged into the Document with a script?
According to this post such words are stored as hyphenation exceptions and therefore accessible with scripting via app.activeDocument.hyphenationExceptions, but words added to the “All languages” language seems to be the exception. This code displays (in the console) all languages and the number of hyphenation exceptions for each language:
var myHyphenations = app.activeDocument.hyphenationExceptions;
var myHyphenationsLength = myHyphenations.length;
for (var i = 0; i < myHyphenationsLength; i++ ) {
myHyphenation = myHyphenations[i];
var myAddedWords = myHyphenation.addedExceptions;
$.write(myHyphenation.name + ": " + myAddedWords.length + "\n");
// myHyphenation.removeException(myAddedWords);
}
which matches what is seen in menu Edit ▸ Spelling ▸ User dictionary ▸ Target: [current doc] for each language listed in the Language drop down menu, except for the “All languages” language. The code above does not account for entries in that language at all, nor lists category even. Are those accessible via scripting at all?
