3 Replies Latest reply on Jun 16, 2009 6:37 AM by littlemookie

    FindChangeList.txt--Change font style

      InDesign CS3

       

      Here's the problem:

       

      I have two basic paragraph styles:

       

      body text--Minion Pro Regular

       

      margin text--Formata Light

       

      I like to format my Word file to the paragraph style that is most often used (body text--Minion Pro Regular). I then proceed to change that base style into other styles that are used in the document (headlines, subheads, ...). The problem is that when I change paragraph styles--body text to margin text--the conversion doesn't use the fonts that we use in the margins.

       

      Wrong Results

      Minion Pro Regular--Formata Regular

      Minion Pro Italic--Formata Italic

      Minion Pro Bold--Formata Bold

       

      Right Results

      Minion Pro Regular--Formata Light

      Minion Pro Italic--Formata Light Italic

      Minion Pro Bold--Formata Medium

       

      The fonts we use in the margin of our book is a lighter-weight font than our main text font. I would like InDesign to change:

       

      Regular to Light--this change usually works since Light is the defining style

      Italic to Light Italic

      Bold to Medium

       

      I know nothing--very little--about applescipts. All I'm trying to do is alter the supporting FindChangeList.txt file.

       

      Here's what I removed from the end of the file:

       

      grep    {find what:"  +"}    {change to:" "}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find all double spaces and replace with single spaces.
      grep    {find what:"\r "}    {change to:"\r"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find all returns followed by a space and replace with single returns.
      grep    {find what:" \r"}    {change to:"\r"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find all returns followed by a space and replace with single returns.
      grep    {find what:"\t\t+"}    {change to:"\t"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find all double tab characters and replace with single tab characters.
      grep    {find what:"\r\t"}    {change to:"\r"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find all returns followed by a tab character and replace with single returns.
      grep    {find what:"\t\r"}    {change to:"\r"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find all returns followed by a tab character and replace with single returns.
      grep    {find what:"\r\r+"}    {change to:"\r"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find all double returns and replace with single returns.
      text    {find what:" - "}    {change to:"^="}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find all space-dash-space and replace with an en dash.
      text    {find what:"--"}    {change to:"^_"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Find all dash-dash and replace with an em dash.

       

       

       

      Here's my replacement:

       

      text    {find what:"", applied font:"Formata", font style:"Italic"}    {change to:"", applied font:"Formata", font style:"Light Italic"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Change Formata Italic to Formata Light Italic.
      text    {find what:"", applied font:"Formata", font style:"Bold"}    {change to:"", applied font:"Formata", font style:"Medium"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Change Formata Bold to Formata Medium.
      text    {find what:"", applied font:"Formata", font style:"Regular"}    {change to:"", applied font:"Formata", font style:"Light"}    {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false}    Change Formata Regular to Formata Light.

       

      This is not a total failure. Italic is changed to Light Italic but then it stops. It doesn't make the other two changes.

       

      Any help in making things totally work will be greatly appreciated. Thanks.

        • 1. Re: FindChangeList.txt--Change font style
          littlemookie Level 1

          Hi there,

           

          Not sure if this will help, but I found these two 'Change font' scripts, which you might be able to edit to fit your needs:

           

          1. Change Fonts throughout document:

           

          #target indesign;

          app.findTextPreferences = app.changeTextPreferences = null;
          app.findChangeTextOptions.includeFootnotes = true;
          app.findChangeTextOptions.includeHiddenLayers = true;
          app.findChangeTextOptions.includeMasterPages = true;
          app.findTextPreferences.appliedFont = "Gill Alt One MT\tRegular";
          app.changeTextPreferences.appliedFont = "Arial\tRegular";
          app.documents[0].changeText();

          app.findTextPreferences.appliedFont = "Gill Alt One MT\tBold";
          app.changeTextPreferences.appliedFont = "Arial\tBold";
          app.documents[0].changeText();

          app.findTextPreferences.appliedFont = "Gill Alt One MT\tItalic";
          app.changeTextPreferences.appliedFont = "Arial\tItalic";
          app.documents[0].changeText();

           

          2. Change Fonts in Paragraph Styles:

           

          for (var i=2; i<app.activeDocument.paragraphStyles.length; i++)
          {

            if (app.activeDocument.paragraphStyles[i].appliedFont.fullName == "Gill Alt One MT")

              app.activeDocument.paragraphStyles[i].appliedFont = "Arial\tRegular";

            if (app.activeDocument.paragraphStyles[i].appliedFont.fullName == "Gill Alt One MT Italic")

              app.activeDocument.paragraphStyles[i].appliedFont = "Arial\tItalic";

            if (app.activeDocument.paragraphStyles[i].appliedFont.fullName == "Gill Alt One MT Bold")

              app.activeDocument.paragraphStyles[i].appliedFont = "Arial\tBold";

          }

           

          Hope that helps,

           

          Peace!

          • 2. Re: FindChangeList.txt--Change font style
            Kasyan Servetsky Level 5

            If you want to avoid those head-scratching "Why the heck doesn't this script work?" moments, use JS version of the script together with Martin Fisher's Record Find Change script, which records settings from Text and GREP tabs in Find-Change dialog. All you have to do is copy and paste a line into your FindChangeList.txt file.

            • 3. Re: FindChangeList.txt--Change font style
              littlemookie Level 1

              Much better, top stuff!