Created
December 3, 2013 21:54
-
-
Save bruienne/7778134 to your computer and use it in GitHub Desktop.
Pure Python version of fix for KM PDEs (and other affected printer makes). Works around sandboxing restrictions in Mavericks that affect non-compliant Print Dialog Extensions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| import os | |
| import sys | |
| import plistlib | |
| import json | |
| import fnmatch | |
| basepath = '/Library/Printers' | |
| for root, dirs, files in os.walk(basepath): | |
| if fnmatch.fnmatch(root, "*PDE*"): | |
| for file in files: | |
| if file.endswith('Info.plist'): | |
| infoplist = os.path.join(root, file) | |
| plist = plistlib.readPlist(infoplist) | |
| if 'PMSandboxCompatiblePDEs' not in plist: | |
| plist['PMSandboxCompatiblePDEs'] = True | |
| plistlib.writePlist(plist, infoplist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment