2 Replies Latest reply on Mar 5, 2012 10:40 AM by [Jongware]

    How can i create paragraph or character style using javascript

    Learner X Level 1

      Hi all,

       

      I  have doubt in create a paragraph style or character style using javascript.

       

      This is the script i am using write now:

       

      app.findTextPreferences.findWhat = NothingEnum.nothing;

      app.changeTextPreferences.changeTo = NothingEnum.nothing;

      app.findTextPreferences.fontStyle = "Italic"

      app.changeTextPreferences.appliedCharacterStyle = "cs_italic";

      app.documents.item(0).changeText();

       

      What the script is exactly doing is if the fontstyle is "Italic" means it automatically apply "cs_italic" style, which  i already  created in the character style pallette.

       

      But what i want is if the fontstyle is (Italic, Bold) means it automatically create a character style related to their fonts after that apply over their styles.

       

      I am new to forum and javascript.

       

      Thanks in advance.....