4 Replies Latest reply on Feb 18, 2014 7:01 PM by rockymcclamrock

    CS6 javascript -  textBox.contents doesn't return full text

    rockymcclamrock

      I'm using script labels to find text boxes of a certain label and get their contents. Sometimes I don't get the full contents back. Is there anything I should be checking to find my error? This is the js I'm using:

       

       

       

      var myDoc= app.activeDocument;

       

      var myPageItems = myDoc.allPageItems;

       

      for (var i =0; i<myPageItems.length; i++)

      {

          if(myPageItems[i].label == "rug details colors 1")  

          {

               var myOverFlowFrame = myPageItems[i];

       

               if(myOverFlowFrame.overflows==true)

               {

                   var fullText = myOverFlowFrame.contents + '';                      

       

                   alert(fullText); 

                  }      

             }

        }

       

      I don't have very much experience scripting against InDesign and would appreciate any help I could get. Is there a better way than .contents to get the text in a text box? Is there an obvious reason why it would fail to retrieve all of the text in some cases?

       

      Message was edited by: rockymcclamrock (removed irrelevant code)