I always wondered how some of the BBEdit features (like Text Filters) worked.
The model of operation is quite simple:
stdin) and run the program over that input.
~/Library/Application Support/BBEdit/Text Filters. I named the following script
JSON Format.py; yes - space and all because that’s what shows up in BBEdit’s menu like this:
I open up a JSON file and run this option, to have it neatly formatted. Voilà!
#!/usr/bin/env python3 """ JSON Format.py This BBEdit TextF Filter formats a json file in the bbedit buffer using python's json module Pradeep Gowda 2022-10-23 """ import json import sys text = sys.stdin.read() print(json.dumps(json.loads(text), indent=2))
~/Library/Application Support/BBEdit/ directory to git and you can use them from different mac machines running BBEdit:
cd ~/Library/Application Support/BBEdit/ git init git push ..blah..
You may want to exclude the
Notes.bbnotebookd directory which contains the “Notes”s.
See also: BBEdit, and jsonfmt