34 Replies Latest reply on Jul 29, 2015 7:51 AM by Vimala lakshmanan

    Getting the attribute value from XML:error in Indesign 2015.0

    Vimala lakshmanan

      Hi,

       

      I can get the attribute value(product_id) from XML in previous InDesign versions. But i am not able to get the product_id value in InDesign CC 2015.0 version.

       

      1. main();
      2. function main()
      3. {
      4.         IterateDocument();
      5. }
      6. function IterateDocument()
      7. {
      8.     for(myCounter = 0; myCounter < app.activeDocument.activeLayer.textFrames.length; myCounter++)
      9.     {
      10.         myStory = app.activeDocument.activeLayer.textFrames.item(myCounter);
      11.         if((myStory.previousTextFrame==null &&  myStory.nextTextFrame==null)||(myStory.previousTextFrame!=null &&  myStory.nextTextFrame==null))
      12.         FitPageItem (myStory);
      13.     }
      14. }
      15. function FitPageItem (mySel)
      16. {   
      17. graphicItems = mySel.allGraphics;
      18. for(g=0;g<graphicItems.length;g++)
      19. {
      20. alert(graphicItems[g].parent.associatedXMLElement.xmlAttributes.itemByName("product_id").v alue);
      21. var tbguid = graphicItems[g].parent.associatedXMLElement.xmlAttributes.itemByName("product_id").value;
      22. .....
      23. .....
      24. }
      25. }

       

      When i am trying to run the script, i am getting the "Object is invalid" error in line number 25th. Please help me to fix this issue in InDesign CC 2015.0 version.

       

       

      Thanks,

      Vimala L