For my reader installation I can access the menu item in the below screenshot with the following method app.execMenuItem("ADBE:SaveAsAccText"). I have not been able to find in the SDK a more direct access method.
The problem is that this opens the save as explorer window and it does not sound like I can automate pressing the save button (also saving to another location).
So my ask is:
1) is there a setup I am missing that would get doc.saveAs() to save as a text file? If yes, can you point me to where?
2) is there an alternative to app.execMenuItem("ADBE:SaveAsAccText") that allows parameters?
3) can parameters (directory path) be passed to the app.execMenuItem("ADBE:SaveAsAccText") that would allow the save button click and new folder path? If yes, how?
Thanks in advance for your help.
Copy link to clipboard
1) No. It seems Adobe failed to update this list for Reader, either on purpose or not. Without this list being populated you can't save the file under a different format.
The only alternative I can think of is to collect all the text in the file one word at a time and then export it.
However, Reader can't create new text files, so your only option is to display the text to the user, possibly using a Dialog object, and then have them copy it from there. That's hardly automated, though, and might be easier to just use the built-in command...
Thanks for response. If I understood you, I tried getPageNthWord, and that was not successful, in that it drops punctuations. So large/decimal numbers are not properly captured. In the end, I used a vba script that sent keys to reader to perform the save as other command.
To include punctuation symbols in the output of getPageNthWord you must specify the bStrip parameter (the third one) as false. By default it's true.