Copy link to clipboard
Copied
Hi all
I have a multi-page (22pages) form with a "Save Form" button on each page.
When I export the file from InDesign into Acrobat I'm currently using "Prepare Form", then selecting multiple instances of the button on each page, then applying the "Execute Menu Item" across all buttons.
However, is there a way to do this using a script?
Just trying to speed up my workflow.
Thanks
M
Copy link to clipboard
Copied
A script can only apply a script as an action. If that's OK with you then yes, you can do it.
So you basically want all these buttons to cause the Save As dialog to open when clicked? What are their names?
Copy link to clipboard
Copied
Yes, I think we're both on the same page. The button names are: Button 1.Page 1, Button 10.Page 2, Button 10.Page 3, Button 10.Page4, etc...etc...
Thanks
M
Appreciate it would probably be a good idea to tidy up the names via InDesign master pages.
Copy link to clipboard
Copied
Is the first one "Button 1.Page 1" or "Button 10.Page 1"? Are these the only buttons in the file?
Copy link to clipboard
Copied
The first button is "Button 1.Page1", then "Button 10.Page 2" and then "Button 10.Page 3", then "Button 10.Page 4", "Button 10.Page 5", "Button 10.Page 6", "Button 10.Page 7", "Button 10.Page 8", "Button 10.Page 9", "Button 10.Page 10" and so on for 20 pages in total.
Copy link to clipboard
Copied
Please answer my second question...
Copy link to clipboard
Copied
Sorry, I have one other button called "Button 9" which already has a script which sends the form by email.
Copy link to clipboard
Copied
OK, then you can do it by running this code from the JS Console:
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
if (f==null) continue;
if (f.name=="Button 9") continue;
if (f.type=="button") f.setAction("MouseUp", "app.execMenuItem(\"SaveAs\");");
}
Copy link to clipboard
Copied
Thanks for this. It worked a treat.
Copy link to clipboard
Copied
This does work, however, it interferes with the signature part of the form and you get the following message
"The document cannot be signed in its current state. Please save the document, close it, reopen it, and then attempt to sign again."
I don't suppose there's a workaround to this?
Thanks
MJ
Copy link to clipboard
Copied
Are you trying to run the code on a signed file?