the addWord-methods expects a array of string. So you've got to open and read the txt. Then split the string to array ...
Shure you want to add those words to every userDictionary regardless of the speech they belong to?
Thank you sir!...
Yes hans i need to import all the speech contains in the text file.
Because I need to detect only the spell errors recently and mistakenly happend while keying text by one.
So i'll import the total text of the document and after new text has been inserted, check for the spell errors typed recently.
Is that possible, to import the txt file, using script.
thank you sir!..
you may try this example for English USA:
var myUserDict = app.userDictionaries;//Should be English USA var txtFile = File('~/Desktop/test.txt'); txtFile.open('r'); wordsArray = txtFile.read().replace(/["'.,:;!?()\/\d\[\]]+/g, ' ').split(/\s+/);//cleaning the text to get only "words" mostly adapted by jongware txtFile.close(); myUserDict.addWord(wordsArray)
thank you -hans-..
much appreciates to you.
thanks & regards,