Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Trying to find out if app.execMenuItem() was a success


Level 4

I'm trying to build a save and close button and want the close to only work if the save was successful.

I'm hitting 2 problems:

-app.execMenuItem("Save") doesn't seem to work, I would liek it to but could use app.execMenuItem("SaveAs") as that does work

-I cannot find out if the save was successful, I can only get it to return "undefined". Does this mean it has no value, or that it just can't read what it is returning?

Many thanks,

4 Replies


Level 10
You cannot do an automatic save is stopping you from doing so. You can do a SaveAs and you know it worked because the user sees a dialog.


Level 6
You should use the doc.saveAs method instead, but there are security restrictions that you have to deal with. It will throw an error if unsuccessful. For closing, use the doc.closeDoc method.



Level 4
Ah, it will throw an error, so a "catch (e)" will work?