Hi Stan,
That approach worked, though twisted slightly. We universally have font substitution turned on, so “not available” got nothing, but
name
of
every
font
whose
status
is
substituted
worked great! I had never used, or thought of using, the status property. I need to read the dictionary more thoroughly.
BTW; in CS5.5 that same glitch occurs - “not available” is interpreted as boolean
not and a variable available.
Thanks for the assist.
Brad
From: Stan Cleveland < email@hidden>
Date: Thursday, June 25, 2015 at 12:49 PM
To: Brad Houston < email@hidden>
Cc: Applescript Users < email@hidden>
Subject: Re: Mac InDesign CS5.5 & fonts
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:
tellapplication "Adobe InDesign CS6"
telldocument "MyDocument.indd"
nameof
fonts whose
status is
not available
endtell
endtell
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
setnotAvailableTerm
to «constant fSTAfsNA»
-- use the variable in place of InDesign's broken terminology
tellapplication "Adobe InDesign CS6"
telldocument "FA12 Performance Plus Catalog_Mens.indd"
nameof
fonts
whose status isnotAvailableTerm
endtell
endtell
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
|