Skip to main content
iBabs2
Inspiring
April 26, 2010
Question

InDesign CS3 script that changes fonts on open

  • April 26, 2010
  • 2 replies
  • 1190 views

Hello.
I am trying to come up with a script that would change a specific group of fonts, that will always show up missing, to the new font. Basically, it is a bunch of our postscript fonts that are now using our open type font. Below is what I have so far. I want to create a list that goes through about 8 fonts that are old and replace them on the fly with the 8 new fonts. This would be great if I could have this happen on open.
Can anyone see what I have and offer some guidance?
thanks
babs

Open this Scriplet in your Editor:

tell application "Adobe InDesign CS3"
   set find text preferences to nothing
   set change text preferences to nothing
  
   tell application "Adobe InDesign CS3"
      
      
       set OLDfont to {"times", "arial"}
       set NEWfont to {"times new roman", "helvetica"}
       --set find what of find text preferences to testString
      
      
      
       tell document 1
          
           repeat with swap from 1 to 2
               set NEWfont to item swap of OLDfont
           end repeat
       end tell
      
   end tell
end tell

This topic has been closed for replies.

2 replies

Participating Frequently
September 20, 2011

HI,

Did you got the script to edit the bunch of style sheets?

Once of our client demand to make all the H&js in a specific way. So I really need such a script.

Prithivirajan

iBabs2
iBabs2Author
Inspiring
September 20, 2011

Hi Prithivi,

I'm sorry...we never got it to work.

They just replaced them all manually.

I wonder if you could put something out on the forum that maybe could achieve this using GREP?

babs

Inspiring
May 3, 2010

For starters, you're going to have to use the correct font names, including correct capitalization. The property you want to change is "applied font", not "find what". And it would probably be more sensible, to go through all paragraph and character styles and make the changes there first, otherwise you'll have troubles again every time you edit stuff.

So start off by getting the name of the font used in every paragraph style, and loop through your list to see if they should be changed. Do the same for character styles. And then do the find/change to find any that have been applied manually.

iBabs2
iBabs2Author
Inspiring
May 4, 2010

Hello,

That's a good idea.

I was thinking of actually setting up a new style sheet for each one with the new open type font and then doing a find and replace on the styles.

If I get that going, then I may take a crack at trying to write a script that would do a find and change of style sheets.

That seems like a more realistic goal.

thanks!

babs