Login About Gallery
Pretty Print JSON
Accepts
Files and Text
COMMENT
‎Pretty Print JSON by @FifiTheBulldog Thank you to @gluebyte for providing valuable insight on the quirks of Shortcuts with dictionaries: https://www.reddit.com/r/shortcuts/comments/gqq43h/dictionaryjson_pretty_print/ This shortcut is inspired by the "JSON Validator and Beautifier" Instant Answer developed by the DuckDuckHack community for DuckDuckGo. If the JSON is invalid, an error is returned.
SCRIPTING
‎If ‎Shortcut Input ‎does not have any value
SCRIPTING
‎Ask ‎Enter JSON to pretty print
Input Type
‎Text
Default Answer
‎Text
SCRIPTING
‎End If
SCRIPTING
‎Get dictionary from ‎If Result
SCRIPTING
‎If ‎Dictionary ‎does not have any value
SCRIPTING
‎Show ‎Invalid JSON
SCRIPTING
‎Otherwise
TEXT
‎Tab character
LIST
SCRIPTING
‎Choose from ‎List
Prompt
‎Indent with
Select Multiple
SCRIPTING
‎If ‎Chosen Item ‎is ‎Tab Menu Item
TEXT
‎'\t'
SCRIPTING
‎Otherwise
SCRIPTING
‎Get numbers from ‎Chosen Item
SCRIPTING
‎End If
URL
‎data:text/html;charset=utf-8,<script>document.write(encodeURIComponent(JSON.stringify( ‎If Result ‎,null, ‎Space ‎)));</script>
SCRIPTING
‎URL ‎Decode ‎URL
SCRIPTING
‎Set name of ‎URL Encoded Text ‎to ‎JSON
DOCUMENTS
‎Show ‎Renamed Item ‎in Quick Look
SCRIPTING
‎Choose from Menu
SCRIPTING
‎Copy JSON to Clipboard
SHARING
‎Copy ‎URL Encoded Text ‎to clipboard
Local Only
Expire At
‎Today at 3 pm
SCRIPTING
‎Exit
SCRIPTING
‎End Menu
SCRIPTING
‎End If

Showcuts

Magic Vars

Screenshot

Submitted Anonymously over a year ago

Visit iCloud (iOS)

Copy iCloud Link

Scan QR Code

0