Make a typeface (font) sampler with AppleScript

Every wanted to find just the right ampersand? Or question mark? Checking it against every font in your system manually would be a pain. Font Book doesn't have the font sampler feature you need to do this.

But the problem can be solved with ... AppleScript:

tell application "TextEdit"
  make new document at the end of documents of it
end tell

set paraIndex to 1

tell application "Font Book"
  set allFaces to get every typeface
  repeat with t in allFaces
    set currentFace to PostScript name of t
    set currentName to displayed name of t
    tell the front document of application "TextEdit"
      set size to 18
      set paragraph paraIndex to "? (" & currentName & ")" & return
      set font of character 1 of paragraph paraIndex to currentFace
      set paraIndex to paraIndex + 1
    end tell
  end repeat
end tell

Join the Conversation


  1. There’s something strange with your quotation marks, Script Editor does not support open quote and close quote. You’ll need to change these to inverted commas instead.

Leave a comment

Your email address will not be published. Required fields are marked *