Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Java Script

Return to Member Forum

  • Author
    Posts
    • #96732

      I got the following code from the website:

      https://forums.adobe.com/thread/708641

      ======Code starts here ====
      replaceTextByFont (“mam”, “man”);
      replaceTextByStyle (“mam”, “man”);

      function replaceTextByStyle (input, output)
      {
      app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
      app.findTextPreferences.findWhat = input;
      app.findTextPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyles.item(“SampleFindStyle”);
      app.changeTextPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyles.item(“SampleReplaceStyle”);
      app.changeTextPreferences.changeTo = output;
      app.activeDocument.changeText();
      app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
      }

      function replaceTextByFont (input, output)
      {
      app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
      app.findTextPreferences.findWhat = input;
      app.findTextPreferences.appliedFont = app.fonts.item(“Arial Bold”);
      app.changeTextPreferences.appliedFont = app.fonts.item(“Arial BoldItalic”);
      app.changeTextPreferences.changeTo = output;
      app.activeDocument.changeText();
      app.findTextPreferences = app.changeTextPreferences = NothingEnum.nothing;
      }

      ======Code Ends here ====

      I request anyone to help me to change the entire code in JavaScript.

Viewing 0 reply threads
  • You must be logged in to reply to this topic.
Forum Ads