Can't get a simple "app.execMenuItem("Save")" to function!
Hi all,
I have a simple script that flattens a page. It works well. I just want to add a command so that the document saves once the page has been flatten:
function Flatten(boolCurrentPageOnly) // Takes a boolean argument
{
if (boolCurrentPageOnly) // Flatten either this page...
{
this.flattenPages(this.pageNum);
app.execMenuItem("Save") //That's where I inserted the new command. All works fine otherwise. Except that it doesn't save the doc.
}
else{
this.flattenPages(); // ...or all pages
app.execMenuItem("Save") //That's where I inserted the new command. All works fine otherwise. Except that it doesn't save the doc.
}}
//Installs the menu
app.addMenuItem({
cName: "Flatten current page",
cParent: "Document",
cExec: "Flatten(true)"});
app.addMenuItem({
cName: "Flatten all pages",
cParent: "Document",
cExec: "Flatten(false)"});
Anything I am doing wrong?
I am on Acrobat 9.
Thanks!
app.execMenuItem("Save")
