Is there a way to do this in Tinderbox or do you use another json tool before import?
In last weeeks demo, I noticed @eastgate showed us “pretty json” format to work with json files.
Although the solutions work with either format, “pretty json” format is much easier to read.
At play here, I think, is the fact that you can likely use runCommand() to send your non-pretty code from $Text to an online prettifier and use the result to replace the $Text with the ‘formatted’ version.
My preference is to use a local tool. I checked at the app store and have found a couple of tools, one to validate then one to “prettify” . Ok but not perfect. Would love to “prettify” in Tinderbox with a template.
@satikusala can you post the template you referred to here for all.
The session last week on JSON was “excellent” but had to jump off after Mark’s part. I will review probably “pretty” manana.
Polite observation: the stamp is a bit hard to spot as there is no /Hints and the stamp has not been named so is listed as ‘stamp name’.
The $Feed holds data using typographic quotes which are not ‘legal’ in JSON. Doubtless an unintended copy paste/artefact, but likely to cause confusion.
Rather than as shown, it think the correct ‘pretty’ print would look more like this:
The main difference is that nested items are indented.
As said a ‘polite’ note, I’m not being negative about using a action code to do this task.
Just for followup for members of the community, the tool I am currently using from the Mac App Store is JSON Editor to validate and prettify json with a single tool.
-local
-validates the file
-prettifies json via Format/Format JSON/JSON5