Skip to main content
nimya88404583
Participant
November 27, 2019
Answered

app.execMenuItem("Save") doesn't save document automatically

  • November 27, 2019
  • 1 reply
  • 1424 views

I have inserted the statement 

 app.execMenuItem("Save")

in functions where I need automatic save to be performed. But the statement doesn't respond. Neither do I get an error. I read in some blog that Adobe will not find an error as  the function Save exists in the menu option. 

Is there any way of automatically saving a document? 

This topic has been closed for replies.
Correct answer Joel Geraci

"Save" is not one of the supported menu items that can be executed. For the complete list, see the link below.

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJS_API_AcroJS%2Fapp_methods.htm%23TOC_execMenuItembc-12&rhtocid=_6_1_8_6_1_11

 

You can use Doc.saveAs and use the Doc.path as the cPath parameter to write over the original file but this only works in a privileged context.

1 reply

Joel Geraci
Community Expert
Joel GeraciCommunity ExpertCorrect answer
Community Expert
November 27, 2019

"Save" is not one of the supported menu items that can be executed. For the complete list, see the link below.

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJS_API_AcroJS%2Fapp_methods.htm%23TOC_execMenuItembc-12&rhtocid=_6_1_8_6_1_11

 

You can use Doc.saveAs and use the Doc.path as the cPath parameter to write over the original file but this only works in a privileged context.