Anda dapat mengubah manajer file default seperti ini, tetapi ForkLift atau Transmit tidak berfungsi seperti yang diharapkan, hanya Path Finder
#!/usr/bin/python2.6
from LaunchServices import LSSetDefaultRoleHandlerForContentType, kLSRolesViewer, LSSetDefaultHandlerForURLScheme
from CoreFoundation import CFPreferencesCopyApplicationList, kCFPreferencesCurrentUser, kCFPreferencesAnyHost, CFPreferencesSetAppValue, CFPreferencesAppSynchronize
applicationBundleIdentifier = "com.cocoatech.PathFinder" #"com.panic.Transmit" #"com.binarynights.forklift2"
LSSetDefaultRoleHandlerForContentType("public.folder", kLSRolesViewer, applicationBundleIdentifier)
LSSetDefaultHandlerForURLScheme("file:///", applicationBundleIdentifier)
applicationIDs = CFPreferencesCopyApplicationList(kCFPreferencesCurrentUser, kCFPreferencesAnyHost)
for app_id in applicationIDs:
CFPreferencesSetAppValue("NSFileViewer", applicationBundleIdentifier, app_id);
CFPreferencesAppSynchronize(app_id);
-g
bendera setara denganNSGlobalDomain
. Itu hanya menulis preferensi ke domain global, daripada ke domain tertentu.