Jump to content

Search the Community

Showing results for tags 'prettify'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Alfred 3
  • Make the Most of Alfred
    • Discussion & Help
    • Bug Reports
    • Alfred Feature Suggestions
    • Themes
  • Alfred Workflows
    • Share your Workflows
    • Workflow Help & Questions
  • Alfred v2 Themes
  • Alfred Remote for iOS
    • Alfred Remote Discussion & Help
    • Remote Connection Troubleshooting


  • Articles
    • Forum Integration
    • Frontpage
  • Pages
  • Miscellaneous
    • Databases
    • Templates
    • Media

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL




Found 1 result

  1. I probably spent far too much time not knowing what I was doing to produce this workflow but now that it will prettify a single obfuscated .json file, I could use some help with improvements: Support prettifying multiple selected files at a time (I've been able to do this with other languages, but haven't figured out how to work with an array of files in python in a Script Filter) Ignore any non-JSON files that might be passed in (currently if you run this against a TXT file, it'll replace the file contents with {query}! (whoops)) Improve the notifications based on whether a single or multiple files were processed I did take a look at @deanishe's Workflow Library or Python but it seemed like overkill for what I wanted to do. Also, I did find several other workflows that will prettify the clipboard's contents, but I specifically want to just handle files in Finder (for now). I found this technique which looked promising, but I kept getting syntax errors in the Script Filter when I would run it: import json import os # Read JSON data from file and pretty print it with open("{query}", "r") as jsonfile: # Convert JSON file to Python Types obj = json.load(jsonfile) # Pretty print JSON data pretty_json = json.dumps(obj, indent=4) print(pretty_json)
  • Create New...