Copy link to clipboard
Copied
Hi Experts
I need to trace the Edit parapgraph style menuActions. Kindly refere the screen shot. For sample I have added only one style but in the live document I have more than 15 styles.
I have started with this but I am failed
edit_right();
function edit_right(){
var myCloseMenuAction = app.menuActions.item("Edit style1...");
var myEventListener = myCloseMenuAction.eventListeners.add("afterInvoke",display, false);
}
function display()
{
alert("You edited the style");
}
Is there any possibilites for Activate/De-activate menu items.
Thanks in advance
1 Correct answer
Hi,
I would advice you to get menu item by it's ID and not by name.
Example:
#targetengine testSession
main();
function main(){
var disableNew = app.menuActions.itemByID(8483).addEventListener("afterInvoke", editPara);
}
function editPara (evt) {
alert ( "You edited the style");
}
For more info and how to get menu ID numbers check this article:
http://tomaxxi.com/2010/08/prevent-executing-menu-items/
Hope that helps.
--
Marijan (tomaxxi)
Copy link to clipboard
Copied
Hi,
I would advice you to get menu item by it's ID and not by name.
Example:
#targetengine testSession
main();
function main(){
var disableNew = app.menuActions.itemByID(8483).addEventListener("afterInvoke", editPara);
}
function editPara (evt) {
alert ( "You edited the style");
}
For more info and how to get menu ID numbers check this article:
http://tomaxxi.com/2010/08/prevent-executing-menu-items/
Hope that helps.
--
Marijan (tomaxxi)
Copy link to clipboard
Copied
Thank you so much for your codes. This is perfect. I am learning from you lot. I have controled the Panel menus in Paragraph and Character.
But the icons in the panel menu allows to delete or create new style. It's possible to disable that also?
Thanks in advance.

