0 Replies Latest reply on May 17, 2010 12:04 PM by ganalon

    A couple javascript questions I cannot find in documentation or sample

    ganalon Level 1

      I currently have a project using javascript with Indesign CS4 on a PC. The documentation, samples and guides for scripting seem incomplete.

       

      1. I do not know how apply a paragraph or character style to a specific character or paragraph of a story.

       

      // apply paragraph style to story Successful.
      title.parentStory.texts.item(0).applyParagraphStyle(mytitle, true);

       

      // Need to apply paragraph or character style to my content
      var title = "This is a headline";
      var body = "/rThis is the body"
      title.contents = title + body;
         
         
      2. I can place an image in a certain rectange but can't figure out how to set the dimensions / scaling I cannot find any documentation on the place() or fit() functions.

       

      r = app.activeDocument.pages[thispage].rectangles.add();
      r.geometricBounds = [202, 27, 261, 281];
      r.place (File (Folder.desktop + "/599383.jpg")), false;

       

      Thanks in advance for any help.