tell application "Finder"
activate
set objResult to ¬
choose file default location (path to fonts folder from user domain) ¬
of type ¬
{"public.truetype-ttf-font", "public.truetype-collection-font", "public.opentype-font", "com.apple.truetype-datafork-suitcase-font", "com.adobe.postscript-lwfn-font"} invisibles true ¬
with multiple selections allowed without showing package contents
end tell
set theLogFile to "" as text
repeat with objFiles in objResult
tell application "Finder"
set theFileIAlias to objFiles as alias
set theFontName to (name of (info for objFiles) as list) as text
set theFileDir to (container of objFiles) as text
set theUnixFilePath to (POSIX path of theFileIAlias) as text
end tell
set theMdlsResult to do shell script "/usr/bin/mdls -name com_apple_ats_name_postscript \"" & theUnixFilePath & "\""
set AppleScript's text item delimiters to {"\r"}
set theResultList to (every text item of theMdlsResult) as list
set AppleScript's text item delimiters to {""}
set numListLine to (count of theResultList) as number
set theLineData to (item 2 of theResultList) as text
set theResultText to my doReplace(theLineData, "\t", "") as text
set theResultText to my doReplace(theResultText, "\"", "") as text
set theResultText to my doReplace(theResultText, ",", "") as text
set theResultTextPostscript to my doReplace(theResultText, " ", "") as text
set theMdlsResult to "" as text
set theMdlsResult to do shell script "/usr/bin/mdls -name com_apple_ats_name_family \"" & theUnixFilePath & "\""
set AppleScript's text item delimiters to {"\r"}
set theResultList to (every text item of theMdlsResult) as list
set AppleScript's text item delimiters to {""}
set numListLine to (count of theResultList) as number
set theLineData to (item 2 of theResultList) as text
set theResultText to my doReplace(theLineData, "\t", "") as text
set theResultText to my doReplace(theResultText, "\"", "") as text
set theResultText to my doReplace(theResultText, ",", "") as text
set theResultTextFamily to my doReplace(theResultText, " ", "") as text
set theMdlsResult to "" as text
set theMdlsResult to do shell script "/usr/bin/mdls -name com_apple_ats_name_full \"" & theUnixFilePath & "\""
set AppleScript's text item delimiters to {"\r"}
set theResultList to (every text item of theMdlsResult) as list
set AppleScript's text item delimiters to {""}
set numListLine to (count of theResultList) as number
set theLineData to (item 2 of theResultList) as text
set theResultText to my doReplace(theLineData, "\t", "") as text
set theResultText to my doReplace(theResultText, "\"", "") as text
set theResultText to my doReplace(theResultText, ",", "") as text
set theResultTextFull to my doReplace(theResultText, " ", "") as text
set theMdlsResult to do shell script "/usr/bin/mdls -name com_apple_ats_name_style \"" & theUnixFilePath & "\""
set AppleScript's text item delimiters to {"\r"}
set theResultList to (every text item of theMdlsResult) as list
set AppleScript's text item delimiters to {""}
set numListLine to (count of theResultList) as number
set theLineData to (item 2 of theResultList) as text
set theResultText to my doReplace(theLineData, "\t", "") as text
set theResultText to my doReplace(theResultText, "\"", "") as text
set theResultText to my doReplace(theResultText, ",", "") as text
set theResultTextStyle to my doReplace(theResultText, " ", "") as text
set theLogFile to theLogFile & "\r\rcom_apple_ats_name_postscript\r" & theResultTextPostscript & "\r\rcom_apple_ats_name_family\r" & theResultTextFamily & "\r\rcom_apple_ats_name_full\r" & theResultTextFull & "\r\rcom_apple_ats_name_style\r" & theResultTextStyle & "\r\r" as text
log theLogFile
end repeat
return theLogFile
to doReplace(theText, orgStr, newStr)
set oldDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to orgStr
set tmpList to every text item of theText
set AppleScript's text item delimiters to newStr
set tmpStr to tmpList as text
set AppleScript's text item delimiters to oldDelim
return tmpStr
end doReplace