8 Replies Latest reply on Sep 25, 2012 8:17 PM by Bill joy

    Text selection

    Bill joy Level 1

      Hi All

      I want to apply underline on selected text but when i select text with itemByRange() then text not selected.

      itemByRange() return array of characters.when i store array of characters in var type variable character and try to

      underline then it give error object is invalid in line 7.In which type of  variable I store character of array. I also try array type of variable but not sucess.How select text ?

       

      var myDocument = app.documents.add();

      var myTextFrame = myDocument.pages.item(0).textFrames.add();

      myTextFrame.geometricBounds = ["10p", "15p", "30p", "35p"];

      myTextFrame.contents = "Adobe Indesign";

      var character=myTextFrame.characters.itemByRange(7,14); // for selection of Indesign in "Adobe Indesign"

      character.underline=true;   // error object is invalid

       

       

      Thanks.