How to execute a menu command
How do I execute a menu command in InDesign? I do it like this in Illustrator.
app.executeMenuCommand("showAll");
I want to execute the "Object > Hide" and "Object > Show all on Spread".
How do I execute a menu command in InDesign? I do it like this in Illustrator.
app.executeMenuCommand("showAll");
I want to execute the "Object > Hide" and "Object > Show all on Spread".
You can use the following code snippet to invoke the menu
var showMenuItem = app.menus.itemByName("$ID/Main").submenus.itemByName("$ID/Object").menuItems.itemByName("$ID/Show All on Spread");
if(showMenuItem.enabled)
showMenuItem.associatedMenuAction.invoke();
var hideMenuItem = app.menus.itemByName("$ID/Main").submenus.itemByName("$ID/Object").menuItems.itemByName("$ID/Hide");
if(hideMenuItem.enabled)
hideMenuItem.associatedMenuAction.invoke();
-Manan
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.