2 Replies Latest reply on Aug 17, 2012 2:46 PM by luchty

    Find Format, Font Style, Character Style, Find and Change,,, Javascript or Applescript

    luchty

      I'm trying my first whoop at a script and I am in dire need of some help. I've downloaded all kinds of example, however most are too elaborate.

      Here's what I'm trying to do:

      A Find/Change, then Find Format (Basic Character Formats; Font Style "Italic")

      Then

      Change Format (Character Style; "my style")

       

      I've tried to create this in Applescript and in ExtendScriptToolkit.

      Yesterday I read Adobes Script intro PDF.... Now, I don't know if I'm more confused or understanding what's going on.

       

      Here's my attempt—

       

      {

                      cstyle = app.activeDocument.characterStyles.add({name:simple_italic});

                      if (italic) cstyle.fontStyle = app.findTextPreferences.fontStyle;

                  }

              }

              app.changeTextPreferences.appliedCharacterStyle = simple_italic;

              app.activeDocument.selection[0].parent.changeText (false);

          }

       

       

      Is this even close?

      Thanks, T—

       

      Screen Shot 2012-08-17 at 1.12.14 AM.png

      Screen Shot 2012-08-17 at 1.11.05 AM.png

      Screen Shot 2012-08-17 at 1.11.43 AM.png