On Jun 25, 2015, at 11:50 AM, "Houston, Brad" < email@hidden> wrote:
I’m writing a script that will run through folders of InDesign files, opening each and changing a number of old fonts to new fonts (by family, matching styles). That’s done. However, if an old font is not active I get an error saying, in one form or another,
that AS is unable to identify font X. Though the error includes the name, and InDesign displays the font name in the “Find Font” and “Find” dialogs, and it can be replaced within InDesign despite it not being active (which is what I want to do), I cannot seem
to get an inactive font’s name in any form (family, style, full, native, etc). Even if I can’t replace it I would like to record that font X was skipped.
Hi Brad,
I wonder if this is related to an AS terminology bug in InDesign. It affects CS6, but perhaps other versions are also affected.
The following code should give you the names of all inactive fonts used within a particular document:
tell application "Adobe InDesign CS6" tell document "MyDocument.indd" name of fonts whose status is not available end tell end tell
Unfortunately, InDesign CS6 does not compile the not available term, but instead interprets not as a logical operator and available as a variable name.
Here's a workaround for the bug: -- variable containing chevron syntax is defined OUTSIDE of InDesign set notAvailableTerm to «constant fSTAfsNA» -- use the variable in place of InDesign's broken terminology tell application "Adobe InDesign CS6" tell document "FA12 Performance Plus Catalog_Mens.indd" name of fonts whose status is notAvailableTerm end tell end tell
I don't know if this is the cause of, or is even related to, your problem, but I hope it helps. Best of luck with it!
Regards, Stan C.
-- "If you have a problem and you think AppleScript is the solution, then you have two problems." -- Adapted from a quotation about regular expressions |