On Wed, Jan 05, 2005 at 07:46:24AM +0100, Xavier Noria wrote:
I have not generalised the script yet, but since it is gonna be something very targeted to what I want to be useful to others anyway, here it goes the starting point which is really simple if you know just a bit of Python. After installing PyObjC[*] this properly modifies a property list (I did the trials with the one for Perl):
And while I am one of those that thinks *every* Mac should have PyObjC installed :-), you can also use Python's Mac standard library plistlib to avoid the dependency.
#!/usr/bin/python
from Foundation import NSMutableDictionary
fg = "foregroundColor"
perl = u"/path/to/your/Perl.tmbundle/Syntaxes/Perl.plist" plist = NSMutableDictionary.dictionaryWithContentsOfFile_(perl)
from plistlib import Plist
perl = u"/path/to/your/Perl.tmbundle/Syntaxes/Perl.plist" plist = Plist.fromFile(perl) ... plist.write(perl)