Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Can I do a Save As by clicking a button?

Avatar

Former Community Member
I have a client who wants to be able to click a button and print a form and also save a copy to a specific location. Is this possible. If so where can I find scripting info that will help me?
3 Replies

Avatar

Level 5
use this line of code in 'Click' event of a button.



app.execMenuItem("SaveAs");



Good luck,

SekharN

Avatar

Former Community Member
Thanks SekharN. Since this form is supposed to be saved to the same location all of the time (that's what they tell me) I wonder if there is a way to hardcode the path into the script.

Avatar

Former Community Member
I am trying to do the same as well. Save the form to a location on the click of a button. The following code is supposed to work but it doesn't for some reason.



var myDoc = event.target;

myDoc.saveAs("/c/ravi.pdf");



neither does - myDoc.saveAs();



however the following works...

app.execMenuItem("SaveAs"); works !!!

myDoc.closeDoc(true); works !!!



could anyone please help me out here. This is simple stuff and its taking a real long time. I am using Adobe Livecycle Designer 7.1.