A tool to generate JSON QuickLook previews for macOS 10.15 Catalina and above

Latest Release: 1.0.0

 

How to Use PreviewJson

Install the app and run it. This will register the availability of the app’s QuickLook extensions, JSON Previewer and JSON Thumbnailer. You can now quit the app: just click OK:

The PreviewJson app UI

To use QuickLook in Finder, select a JSON file — one with the extension .json — and press space. This will pop up a rendered preview of the file, either as pure data:

A PreviewJson sample

Or including JSON markers:

A PreviewJson sample

You will also see JSON file previews in Finder’s preview pane, enabled using View > Show Preview or by hitting Cmd-Shift-P, and in the Preview: section of Finder’s file info panel (select a file and hit Cmd-I).

You can disable or re-enable JSON Previewer and/or JSON Thumbnailer in System Preferences > Extensions:

Control PreviewJson extensions in System Preferences, Extensions

For some background information on how Catalina delivers QuickLook previews, you might like to read this blog post.


Customise the Preview

Open the Preferences panel from the main app’s PreviewJson menu. This allows you to adjust some of the key elements of the preview:

  • The colour of object keys.
  • The preview’s font and style.
  • The preview’s text size, from 10pt to 28pt.
  • The level of indentation.
  • Whether previews should be displayed white-on-black even in macOS Dark Mode.
  • Whether previews should include raw JSON if rendering fails because the JSON was malformed.
  • Whether previews should include JSON markers for objects ({ and }) and arrays ([ and ]).

Choose your preferred text size using the slider, then pick the monospace font you want the file to be presented in:

The PreviewJson app preferences font selection

Choose your preferred key colour by clicking the colour well to pop up macOS’ colour picker. As you make your colour selection, the colour well will be updated:

The PreviewJson app preferences colour selection

Click Save to apply your choices.

Changing these settings will affect previews straight away, but may not affect thumbnails until you open a folder that has not been previously opened during the current login session.


Feedback and Bug Reports

You can use the main app to submit feedback. Just click in the Send Feedback button in the main window, or select Report a Bug… from the Help menu:

The PreviewJson app feedback mechanism

Please include your email address if you would like a response. I can’t respond without one. Please see the privacy policy for details of email address usage.


Troubleshooting

If PreviewJson reports that it was unable to render JSON, this is almost certainly caused by a malformation of the JSON itself. For this reason, you can optionally tell PreviewJson to display a file’s raw JSON in the event of a parsing error. This option is chosen in the Preferences panel and will allow you to QuickLook even bad JSON files, just without rendering.

Enjoyed Using PreviewJson?

If you have found PreviewJson to be useful, please consider writing a positive review on the Mac App Store, or simply give it a rating.

Thank you!


Source Code

You can view PreviewJson’s source code at GitHub.


Release Notes

  • 1.0.0 2 October 2021
    • Initial public release.

Related Software


The Seal of RassilonThe Seal of Rassilon
Site and software copyright © 2022, Tony Smith