READER javascript to save as other text

New Here ,
Sep 20, 2021 Sep 20, 2021

Copy link to clipboard

Copied

Hi all;

 

I am trying to automate saving as a text file from Reader with a folder level javascript. doc.saveAs() does NOT work as there are no PDF converters in Reader (app.fromPDFConverters.length; returns as undefined, this also matches with looking in the save as menu item and seeing only pdf as the only save type option). 

 

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.

 

saveasother.PNG

 

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.

 

Views

104

Likes

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

correct answers 1 Correct answer

Adobe Community Professional , Sep 20, 2021 Sep 20, 2021

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.

2+3) No.

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, a

...

Likes

Translate

Translate
Adobe Community Professional ,
Sep 20, 2021 Sep 20, 2021

Copy link to clipboard

Copied

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.

2+3) No.

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...

Likes

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
New Here ,
Sep 23, 2021 Sep 23, 2021

Copy link to clipboard

Copied

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. 

Likes

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
Adobe Community Professional ,
Sep 24, 2021 Sep 24, 2021

Copy link to clipboard

Copied

LATEST

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.

Likes

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