2 Replies Latest reply: Jun 20, 2012 6:45 AM by Learner X RSS

    Apply Color in arrays

    Learner X Community Member

      Hi all,

       

      I am new to script. While working on CS3 scripting Guide i am creating a new paragraph style and apply all the properties like fontsize, fontstyle, fillcolor, filltint etc.... But in fillColor suppose i am using the name like (red, cyan etc) it works, but if i use like [100, 0, 0, 0] it not works.  See the fifth line FYI.

       

      Where i did a mistake.

       

      1. var myDocument = app.activeDocument;

      2. var myPstyle = myDocument.paragraphStyles.add({name: "H1"});

      3. myPstyle.pointSize = 18;

      4. myPstyle.fillColor = "red";

       

      5.  //myPstyle.fillColor = [15, 100, 100, 0];

       

       

      And one more doubt.

       

      For Creating New ParagraphStyle:

      app.activeDocument.paragraphStyles.add();

       

      For Creating New CharacterStyle:

      app.activeDocument.characterStyles.add();

       

       

      Is it correct:

       

      For Creating Swatches:

      app.activeDocument.swatches.add();

       

       

      Thanks in advance. Again for your remembrance i am a learner in scipt.