Skip to main content
February 16, 2011
Question

[JS] app.menuActions on XMLElement

  • February 16, 2011
  • 1 reply
  • 414 views

Hi,

I'm trying to apply italics using xml rules and this method : http://forums.adobe.com/thread/744713

function Italique() {

     this.name = "Italique";

     this.xpath = "//hi[@rend='italic']";

     this.apply = function(myElement, myRuleProcessor){

          with(myElement){

               app.select(myElement);

               app.menuActions.itemByID(119611).invoke();

          }

          return true;

     }

}

myElement is an XMLElement who contains exactly what I want but at :

app.menuActions.itemByID(119611).invoke();

a javascript error occurs : n° 54 at line 78 of the "glue code.jsx" file.

"Exception Javascript non interceptée : Erreur : Le script n'est pas activé"

In English : the script isn't activated.

I don't know what to do.

Help me please!

This topic has been closed for replies.

1 reply

February 22, 2011

Hi,

I figured it out by myself : I wasn't selecting the good object.

With

myElement.texts.item(0).select();

it works fine!