I am facing an issue with invoking menu items in scripts. Here is an example:
app.menuActions.item("$ID/Override All Master Page Items").invoke;
app.menuActions.item("$Override All Master Page Items").invoke;
app.menuActions.itemByID(6164).invoke;
app.menuActions.item("$ID/Select All").invoke;
app.menuActions.item("Select All").invoke;
app.menuActions.itemByID(276).invoke;
alert("Done");
Despite the code above, only the alert message is displayed at the end.
I have confirmed that the IDs are correct and the action name is unique (at least for "Override All Master Page Items") by running:
myMenuActions = app.menuActions.itemByName("Override All Master Page Items").getElements();
for (var i = 0; i < myMenuActions.length; i++) {
alert(myMenuActions[i].area + " " + myMenuActions[i].id);
}
I have also consulted Kaysan's guide to scripting menu items in InDesign, but I still haven't found a solution.
Any suggestions on what might be causing this issue? (I would prefer to use locale-independent names to reference menu items instead of IDs, but I am open to any solution at this point.)
My setup includes InDesign CC 2014 on Windows 10, and I am using Notepad++ to edit scripts, not the Adobe ExtendScript environment. Thank you in advance!