Article View: adobe.scripting.indesign
Article #530Re: [AS CS3] Getting fonts of placed InDd docs (imported pages, or graphics)
From: Shane_Stanley
Date: Thu, 12 Mar 2009 21:57
Date: Thu, 12 Mar 2009 21:57
39 lines
2715 bytes
2715 bytes
I got similar results when I tried with a slightly more complex document
than before. Assuming the count is correct, and that all you want to know is
whether any are missing, you could get the count, loop through asking for
the names by index, and then check whether all the names are unique.
Something like this:
tell application "Adobe InDesign CS3"
set n to count of fonts of document 1 -- assume reliable
set theFonts to fonts of document 1 -- assume unreliable
if (count of theFonts) is not n then -- mismatch
set fontNames to {}
repeat with i from 1 to n
set end of fontNames to name of font i of document 1
end repeat
-- see if font names are duplicated
repeat with i from 1 to (n - 1)
set oneFont to item 1 of fontNames
set fontNames to rest of fontNames
if fontNames contains oneFont then
-- there's a duplicate
set fontProblem to true
exit repeat
end if
if i = n - 1 then
-- no duplicates found
set fontProblem to false
end if
end repeat
else
-- counts match, so all is well
set fontProblem to true
end if
end tell
return fontProblem
--
Shane Stanley <sstanley@myriad-com.com.au>
AppleScript Pro Sessions <http://scriptingmatters.com/aspro>
Technical Details
Message-ID:
<C5DFD07F.4F4F2%sstanley@myriad-com.com.au>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossingReferences:
<59b82edb.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,509a2126c4981431 X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Shane_Stanley@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: [AS CS3] Getting fonts of placed InDd docs (imported pages, or graphics) Message-ID: <C5DFD07F.4F4F2%sstanley@myriad-com.com.au> Date: Thu, 12 Mar 2009 14:57:35 -0700 References: <59b82edb.-1@webcrossing.la2eafNXanI> Lines: 44 Received: from outbound.icp-qv1-irony-out4.iinet.net.au [203.59.1.150] by adobeforums.com; Thu, 12 Mar 2009 14:58:12 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag8CAM8huUl8qAah/2dsb2JhbAAI0VuEDQY X-IronPort-AV: E=Sophos;i="4.38,352,1233500400"; d="scan'208";a="324132495" Received: from unknown (HELO [10.1.1.4]) ([124.168.6.161]) by outbound.icp-qv1-irony-out4.iinet.net.au with ESMTP; 13 Mar 2009 06:57:38 +0900 User-Agent: Microsoft-Entourage/12.15.0.081119 Thread-Topic: [AS CS3] Getting fonts of placed InDd docs (imported pages, or graphics) Thread-Index: AcmjXY0F09evK45TJUuAIVbk2j98fg== MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit