Need Script to collect all misspelled words
Hi team,
I am working is Medical based text jobs in english where I have so many medical words which not usually present in User dictionary. so it will shown as dynamic spell error.
To rectify this I whould like to collect all dynamic spell error words later I will add all in dictionary.
I tried the below script, its not working
// InDesign ExtendScript to collect misspelled words
// Access the active document
var doc = app.activeDocument;
// Check if there are any misspelled words
if (doc.spellingErrors.length > 0) {
var misspelledWords = [];
// Iterate through each misspelled word
for (var i = 0; i < doc.spellingErrors.length; i++) {
var error = doc.spellingErrors[i];
var misspelledWord = error.contents;
// Add the misspelled word to the array
misspelledWords.push(misspelledWord);
}
// Output the collected misspelled words
alert("Misspelled Words: \n" + misspelledWords.join(", "));
} else {
alert("No misspelled words found in the document.");
}
Please give some idea to achive the task.
Regards
Nousheeth
