Hi,
I would like to be able to open Illustrator files and then check if there’re any fonts missing in the document. I have turned the user interaction off so that no dialogs appear when opening a document with fonts missing. I thought I might be able to check for missing fonts using the “Text font properties”, but it doesn’t matter what syntax I use Illustrator always errors. I think this is because Illustrator can only get the Text font properties of “An Installed Font”. As a last resort I tried extracting data from XMP string but it only seems to tell me the name of the fonts and not there status. Any advice on the syntax for “Text font properties” or a workaround would be much appreciated.
Thanks,
Nik
on AnalyzeDocumentFonts() – Generates a list of document fonts and missing fonts
tell application “Adobe Illustrator”
set documentProperties to (get XMP string of current document)
set documentFonts to {} -- Global variable
set missingFonts to {} -- Global variable
repeat with x from 1 to count of paragraph in documentProperties
if paragraph x of documentProperties contains "fontName" then
set continueCount to x
set fontNameChars to every character in paragraph x in documentProperties
set fontName to text 35 thru -18 of fontNameChars as string -- Extracts characters from <stFnt:fontName>GillSans-ExtraBold</stFnt:fontName>
repeat with y from continueCount to (continueCount + 3)
if paragraph y of documentProperties contains "fontType" then
set fontTypeChars to every character in paragraph y in documentProperties -- Extracts characters from <stFnt:fontType>Unknown</stFnt:fontType>
set fontType to text 35 thru -18 of fontTypeChars as string
end if
end repeat
if fontType = "Unknown" then
set end of missingFonts to fontName -- Contains a list of all missing fonts in current document
else
set end of documentFonts to fontName -- Contains a list of all fonts used in current document
end if
end if
end repeat
end tell
end AnalyzeDocumentFonts