Skip to content

Instantly share code, notes, and snippets.

@sugarmo
Last active December 6, 2020 03:06
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sugarmo/5670656 to your computer and use it in GitHub Desktop.
Save sugarmo/5670656 to your computer and use it in GitHub Desktop.
A shell script for Automator that can convert JSON to .plist file.
for f in "$@"
do
filename="${f%.*}"
plutil -convert xml1 "$filename".json -o "$filename".plist
done
@sugarmo
Copy link
Author

sugarmo commented May 29, 2013

Usage

  1. Open Automator and create a new workflow with Service type.
  2. Choose Run Shell Script.
  3. Copy this gist to the code field.
  4. Save the workflow. The name of the workflow is up to you, it will become the service name.

Now, just choose a .json file in Finder, and pop up the context menu, choose Convert to plist (or other name you had just gave), then there would be a .plist file.

Hope this can help :)

@rex
Copy link

rex commented Feb 13, 2015

DUUUUDE. This is EXACTLY what I have been looking for. Hot damn I'm excited. I'm working on doing some serious customization of my Sublime theme/color scheme and the thought of writing a bunch of difficult-to-understand .plist files is miserable. But then this.

I'm going to try and build in a way to support variables, but if I make it happen and I remember to update here, I'll post my solution.

You. Rock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment