Copy link to clipboard
Copied
I am very new to scripts, and I just have a ponctual need.
I have a document using fonts no longer available.
I would like to run a script that will change the definition of all paragraphs using for example the "xxx1" font to "xxx2".
That must be pretty easy, but some help would save me a lot of time learning how to write scripts. I don't know the ExtendScript language.
Thanks.
If it's just one file, it might be easier to
save it as .mif,
open it in a plain text editor (Notepad will do),
examine some of the font declarations so you know what they look like,
perform a single CTLh find/change,
re-save, and
re-open in FM.
Try the following:
FrameMaker menue -> View - Panel -> Fonts
and then: replace Fonts
Copy link to clipboard
Copied
If it's just one file, it might be easier to
save it as .mif,
open it in a plain text editor (Notepad will do),
examine some of the font declarations so you know what they look like,
perform a single CTLh find/change,
re-save, and
re-open in FM.
Copy link to clipboard
Copied
Brillant, thanks!
Copy link to clipboard
Copied
Be sure to keep a copy of the pre-change file.
It would also be worthwhile to create a short document with the new font, and examine its MIF.
Font declarations in MIF can look different from the font names in the menus, e.g.
‹FPlatformName `W.Source Sans Pro Semibold.R.600'›
‹FFamily `Source Sans Pro Semibold'›
And what you need to change may involve more than just the name:
‹FWeight `SemiBold'›
For short text strings needing bulk change, there's also a minor risk of unintended changes. Fragments of font tags can appear all over the place. FM files can also contain various binary objects, presented in MIF as somewhat random-appearing blocks of hexadecimal. There is some risk that the string you are changing could semi-randomly appear in a hex object. So when changing:
‹FPlatformName `W.Source Code Pro.R.400'›
to
‹FPlatformName `W.Source Serif Pro.R.400'›
don't just change [Code] to [Serif]. Quote as much of each string as you can.
☑ Match Case
Plan B would be to create a small default document (template.fm).
File🞃Import…Formats
☑ Paragraph Formats only
from the active document (working.fm).
Revise just the ¶formats of interest in template.fm
Then with the working.fm, and template.fm still open, you can, in working.fm
File🞃Import…Formats
of just
☑ Paragraph Formats
from template.fm
Copy link to clipboard
Copied
Thanks for plan B. In retrospect, less risky.
I did keep a backup just in case of the old .fm just in case, but I saved as PDF and I did a (quick) side b side comparison between the 2 PDFs, without noting anything amiss.
This and the way I posted in the other thread to eliminate the hang-ups solved all the upgrade problems.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Very nice, thanks!.