2 Replies Latest reply on Oct 22, 2009 12:45 AM by ChocoboKnight

    Check of paragraph text is bold or Italic [JS] CS3

    ChocoboKnight

      Hi,

       

      i'm trying to write a script to check a document paragraph my paragraph and change the text to leading 8 and point size if it is not bold or Italic. The problem i'm having is trying to retrun a value which i can used to find out of the paragraph text is bold and or Italic.

       

      Does anyone know how to do this?

       

      here's what i have so far;

       

      var the_document = app.documents.item(0);
      var the_story = app.selection[0].parentStory;

      counter = 0;

      do{
        var current_paragraph = the_story.paragraphs.item(counter)
       
       

       
        with(the_document.textDefaults){
       
         var mytextobject = current_paragraph.texts.firstItem();
         mytextobject.leading = 8;
         mytextobject.pointSize = 7;
         }
         
        counter++;
      }while (counter < the_story.paragraphs.length);