Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
7

Need Script to collect all misspelled words

Explorer ,
Dec 12, 2023 Dec 12, 2023

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

TOPICS
How to , Import and export , Scripting
241
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 12, 2023 Dec 12, 2023

Rookie responding, so please be kind if this is totaly incorrect 🙂
Might this line:
misspelledWords.push(misspelledWord);
need to be modified as
misspelledWords.push($misspelledWord);
to insert the word as a text string?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 12, 2023 Dec 12, 2023

The document object doesn't have the property spellingErrors. Is it maybe part of a scriptable plug-in that you installed? Did you write the script yourself?

 

P.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 13, 2023 Dec 13, 2023

HI Peter kahrel,

I got this from a facebook community friend but its not working, and I'm Unable to reach them back.

kindly letme know if any other option to achive my task

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 12, 2023 Dec 12, 2023

This may not address any of your needs or interests, but be aware that one spell-checking 'language' is USA Medical. (There's also a USA Legal.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2023 Dec 13, 2023
LATEST

@Nousheeth -- Did you see James's comment about the US medical word list?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines