Copy link to clipboard
Copied
Hi!
I'm using Acrobat DC Pro. I want to spell check a folder of documents one by one using Javascript. I want a dialog box to pop up only if there is a spelling error in a file. I only want the dialog for when there are errors. I want to be able to correct the error via the dialog box. After I correct the error, I want the spell checking to continue until the end of the folder.
Alternatively: I want a javascript program to spell check a folder a file at a time and to copy only the files that have an spelling error to a temporary folder.
thanks!@ !
Copy link to clipboard
Copied
Is the text that you want to check static text or part of a comment or a
field?
Copy link to clipboard
Copied
the main body of the document
Copy link to clipboard
Copied
OK, in that case the first part is not possible, as a script can't change the actual text of the file. It can highlight the misspelled words, but that's about it.
The second part is possible. You would need a script that iterates over all the words in the file and spell-checks each one (using a pre-defined dictionary). If a misspelling is found the file can be saved to another folder and the loop can be broken.
You would then use this script in an Action on your files.
I've developed a Spell-Check Suite for Acrobat (See: Custom-made Adobe Scripts: Acrobat -- Spell Check Suite ), so creating such a script and putting it in an Action should not be too difficult. If you're interested feel free to contact me (try6767 at gmail.com) and we could discuss it further.
Copy link to clipboard
Copied
I think I'll try exporting the whole folder of files to text files and then using the natural language toolkit to find misspellings. Do you know if there is a way for javascript to export a whole folder of files in a loop so I don't have to do each one at a time.
Copy link to clipboard
Copied
Isn't that as simple as using a loop with the javascript saveAs command with the line that uses SaveAs then the filename.rtf or the filename.txt that I want the pdf exported to?
Copy link to clipboard
Copied
No. You would need to use an Action (via Tools - Action Wizard) and then set it to save the files its processing as text files. You actually don't need JS at all to do it.