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.parentStory;
counter = 0;
var current_paragraph = the_story.paragraphs.item(counter)
var mytextobject = current_paragraph.texts.firstItem();
mytextobject.leading = 8;
mytextobject.pointSize = 7;
}while (counter < the_story.paragraphs.length);
The font style is held in a text property called "fontStyle", a simple text string holding something like "Regular", "Italic", "Bold", or "Bold Italic" (or, depending on your font, something like "Condensed Light", "Extended Bold #2" or "76 Black Italic").
Beware: you appear to be checking entire paragraphs. If the fontstyle is mixed, the property will be undefined. It will only be "Bold" or "Italic" if the entire paragraph including its final return is in Bold or Italics.
Thanks a bundle