7 Replies Latest reply on May 29, 2017 3:02 AM by sangeethak65390815

    Report for behind the text frame from rectangle or image

    selvam214 Level 1

      Hi All,

      How to find and report the hidden text frames, example the below text frame behind the rectangle frame.


      Note: we must ignore the grouped, anchored and wrap objects.


      Screen Shot 2017-01-27 at 6.48.32 pm.png


      Screen Shot 2017-01-27 at 6.49.02 pm.png


      The below sample is not working

      //An InDesign file with two objects on the same page,  

      //one text frame and one rectangle that holds an image. 


      var d=app.documents[0]; 


      var myImageContainerDup = d.allGraphics[0].parent.duplicate(); 

      var myTextFrameDup = d.textFrames[0].duplicate(); 


      //Make a selection: 



      //ID for New MultiStateObject: 83621 

      //Adding a MultiStateObject (MSO) with the two selected objects: 

      try{app.scriptMenuActions.itemByID(83605).invoke()}catch(e){alert(e);$.writeln("Something went wrong!");exit()}; 


      //The object in the front goes to state 1 

      //The object in the back goes to state 2 


      var myMSO = d.multiStateObjects[-1]; 

      //State 1 

      $.writeln("Front:"+"\t"+myMSO.states[0].groups[0].pageItems[0].getElements()[0].constructo r.name); //=> "TextFrame" if text frame is in front 

      //State 2 

      $.writeln("Back:"+"\t"+myMSO.states[1].groups[0].pageItems[0].getElements()[0].constructor .name); //=> "TextFrame" if text frame is in the back 








      Thanks in advance,