I am trying to delete all disabled fonts that are located in the Macintosh HD:Library:Fonts folder.
I would not attempt to script this if I didn’t have several machines that I would like to do this on.
At this point I’m just trying to get it to list the disabled fonts in just this folder.
This seems to work until I do something like add a “q” to the path:
There are fonts that begin with Q in this folder.
At that point, I get the following error:
error “Font Book got an error: Can’t get font container of typeface id "file:///Library/Fonts/Didot.dfont#postscript-name=Didot".” number -1728 from font container of typeface id “file:///Library/Fonts/Didot.dfont#postscript-name=Didot”
Any suggestions would be appreciated.
tell application "Font Book" set disabledFonts to typefaces whose enabled = false set disabledCount to count of disabledFonts repeat with itemNum in disabledFonts set parentName to path of font container of itemNum if (parentName as string) contains "/Library/Fonts/q" then display dialog parentName end if end repeat end tell
Browser: Firefox 21.0
Operating System: Mac OS X (10.7)