8 Replies Latest reply on Apr 13, 2011 2:39 AM by stoereee

    [JS IDCS5 Server] app.menuActions.item("Go to Item").invoke();

    stoereee Level 1

      I've the following script applies xml attributes values to graphic scale, frame size and offset:

       

      #include "glue code.jsx";
      
      main();
       
      function main(){
       
      var myDoc = app.activeDocument;
      var myRuleSet = new Array (
      new findObjAttribute("//Afbeelding")
      );
       
      with(myDoc){
      var elements = xmlElements;
      __processRuleSet(elements.item(0), myRuleSet);
      }
      }
      
       
       
      function findObjAttribute(XPATH){
      this.name = "Afbeelding";
      this.xpath = XPATH;
      this.apply = function(myElement, myRuleProcessor)
      {
      with(myElement){
      try {
      var myXmove=myElement.xmlAttributes.itemByName("yoffset").value;
      var myYmove=myElement.xmlAttributes.itemByName("xoffset").value;
      var myHeight=parseInt(myElement.xmlAttributes.itemByName("height").value);
      var myWidth=parseInt(myElement.xmlAttributes.itemByName("width").value);
      var myScale=parseInt(myElement.xmlAttributes.itemByName("scale").value);
      
                app.select(myElement);
                  try {
                      app.menuActions.item("Go to Item").invoke();
                      }catch(e){};
                      app.selection[0].graphics[0].move(undefined, [myYmove, myXmove]);
                      app.selection[0].geometricBounds = [0, 0, myHeight, myWidth];
                      app.selection[0].graphics[0].horizontalScale = myScale;
                      app.selection[0].graphics[0].verticalScale = myScale;
                  app.selection = null;
           } 
      catch(e){};
      }
      return true;
      }
      }
      
      

       

      On InDesign Desktop it is working fine. On InDesign Server it is not working!?

       

      app.menuActions.item("Go to Item").invoke();

       

      Is the above line not working on InDesign Server because it has no interface? And how to script it to make it work?

       

      Regards, Sjoerd