Last Updated: February 25, 2016
·
1.105K
· mimieam

Json to plist (XML)

while learning about *.tmLanguage for ST3 it turns out that all the nice tools for dealing with XML plist were not yet compatible with ST3 so after some digging i found this fairly simple python library (plistlib) that did the trick for me

import plistlib , json, sys

src= sys.argv[1]  

if src.endswith('json'):
    json_text = json.load(open(src))
    plistlib.writePlist(json_text , 'output.plist')

save the above under JtoP.py for instance and use it by simply calling python JtoP.py filename.json