• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to trace menuActions

Participant ,
Apr 04, 2012 Apr 04, 2012

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");   

    }

ar1.JPG

Is there any possibilites for Activate/De-activate menu items.

Thanks in advance

TOPICS
Scripting

Views

746

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advisor , Apr 04, 2012 Apr 04, 2012

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)

http://tomaxxi.com

Votes

Translate

Translate
Advisor ,
Apr 04, 2012 Apr 04, 2012

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)

http://tomaxxi.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 05, 2012 Apr 05, 2012

Copy link to clipboard

Copied

LATEST

Hi Marijan Tompa

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?

ar2.JPG

Thanks in advance.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines