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

Need Help in Collecting Medical Terms words Flagged by Dynamic Spelling in InDesign

Explorer ,
Jul 25, 2024 Jul 25, 2024

Copy link to clipboard

Copied

Hi everyone,

I'm a graphic designer working on medical-related projects, and I often encounter technical medical terms in my InDesign files. Unfortunately, many of these terms are highlighted as spelling errors by InDesign's dynamic spelling feature, even when they are correct. Sometimes, genuine misspellings get overlooked because they resemble legitimate medical terms. I tried US Medical Disctionary. But its not covering all the Medical words.

To streamline my workflow, I'm considering extracting all the words flagged by dynamic spelling from my proofread and approved files. I plan to compile these terms into a list and add them to my user dictionary in InDesign.

Could anyone advise on the best way to collect these dynamically highlighted words in bulk? If there are any scripts or methods to automate this process, I'd appreciate your recommendations.

Thanks in advance for your help!

I tried the below script, but its not collecting the words

try {
// Get the active document
var doc = app.activeDocument;

// Get the document name without the extension
var docName = doc.name.replace(/\.[^\.]+$/, '');

// Define the file path with the same name as the document and .txt extension
var filePath = doc.filePath + "/" + docName + "_spelling_errors.txt";
var file = new File(filePath);

// Get all text in the document
var allText = doc.stories.everyItem().texts.everyItem().getElements();

// Array to store misspelled words
var misspelledWords = [];

// Loop through all text items and check for spelling errors
for (var i = 0; i < allText.length; i++) {
var words = allText[i].words.everyItem().getElements();
for (var j = 0; j < words.length; j++) {
// Additional check to ensure we're dealing with a word object
if (words[j].isValid && words[j].hasOwnProperty('isMisspelled')) {
if (words[j].isMisspelled) {
misspelledWords.push(words[j].contents);
}
} else {
// Debugging output to see what's being processed
$.writeln("Not a valid word object or does not have 'isMisspelled' property: " + words[j].contents);
}
}
}

// Write misspelled words to the file
file.open('w');
if (misspelledWords.length > 0) {
file.writeln(misspelledWords.join('\n'));
} else {
file.writeln("No misspelled words found.");
}
file.close();

alert("Spelling errors have been saved to " + file.fullName);
} catch (e) {
alert("An error occurred: " + e.message);
}

TOPICS
Scripting

Views

94

Translate

Translate

Report

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 ,
Jul 25, 2024 Jul 25, 2024

Copy link to clipboard

Copied

Word object doesn't have "isMisspelled" property.

 

Votes

Translate

Translate

Report

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 ,
Jul 25, 2024 Jul 25, 2024

Copy link to clipboard

Copied

Googling 'indesign script typos' produces (among other things):

 

https://community.adobe.com/t5/indesign-discussions/script-to-extract-a-list-of-all-spelling-errors-...

Votes

Translate

Translate

Report

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 ,
Jul 25, 2024 Jul 25, 2024

Copy link to clipboard

Copied

LATEST
quote

Googling 'indesign script typos' produces (among other things):

 

https://community.adobe.com/t5/indesign-discussions/script-to-extract-a-list-of-all-spelling-errors-...


By @Peter Kahrel

 

Yeah, not "pretty" but could be run overnight on multiple files, specific layers / Stories, pre-selected texts, etc... 

 

Votes

Translate

Translate

Report

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