2 Replies Latest reply on Dec 7, 2011 5:41 AM by B0b_The_Bui1der

    Help with script

    B0b_The_Bui1der Level 1

      Hi all,

       

      I need to create a script that lets me change the horizontal Scale of a font type in a document to 80%.

       

      For example say I have text set as Fruitiger Condensed and I want to change all instances of this text in document to Helvetica Regular at 80% horizontal scale.

       

      Just to summerize, firstly it's a change of font followed by a change of Horizontal scale.

       

      Is this possible and how can it be done?

       

      This was my attempt to no avail:

       

      app.findTextPreferences = app.changeTextPreferences = null;

      app.findChangeTextOptions.includeFootnotes = true;

      app.findChangeTextOptions.includeHiddenLayers = true;

      app.findChangeTextOptions.includeMasterPages = true;

      app.findTextPreferences.appliedFont = "Fruitiger LT\t57 Condensed";

      app.changeTextPreferences.appliedFont = "Helvetica Linotype\tRegular";

      app.changeTextPreferences.horizontalScale = 80;

      app.documents[0].changeText();

       

      The changeText works but the horizontalScale does not.

       

      Thanks

        • 1. Re: Help with script
          csm_phil Level 4

          Hi Bob,

           

          I have checked your code its working fine in my end.

          Please ensure the fonts are available in your system.

           

          app.findTextPreferences = app.changeTextPreferences = null;
          app.findChangeTextOptions.includeFootnotes = true;
          app.findChangeTextOptions.includeHiddenLayers = true;
          app.findChangeTextOptions.includeMasterPages = true;
          app.findTextPreferences.appliedFont = "Avenir LT Std\t55 Roman";
          app.changeTextPreferences.appliedFont = "Courier\tRegular";
          app.changeTextPreferences.horizontalScale = 80;
          app.documents[0].changeText();
          

           

           

          thx

          csm_phil

          • 2. Re: Help with script
            B0b_The_Bui1der Level 1

            Thanks Phil,

             

            Yes I had my font named wrongly in my script...Fruitiger should have been Frutiger! Doh!