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

2 Responses to Make a typeface (font) sampler with AppleScript

  1. Andy says:

    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.

  2. paul says:

    Oh, that’s WordPress auto-converting the quotation marks to make them curly.

Leave a Reply

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