Is there a way to set ForkLift as the default file viewer, to a degree? PathFinder somehow does this, see http://cocoatech.com/faqs#3, but how does it do this and could that option be set to redirect to ForkLift instead of PathFinder?
4 Answers
Path Finder looks like it's modifying the "NSFileViewer" preference. You can set this manually from Terminal to point to ForkLift (I tried this, and it seems to work):
defaults write -g NSFileViewer -string com.binarynights.ForkLift2
(The -g
sets this preference globally for all applications.)
However, be warned that the Path Finder website lists some applications that don't respect this setting, such as the Dock and Firefox.
-
The
-g
flag is equivalent toNSGlobalDomain
. It simply writes the preference to the global domain, rather than to a specific domain. Mar 25, 2012 at 8:43 -
Very interesting, thanks! Seems to work well for the applications that do support it! Mar 26, 2012 at 12:19
-
-
3
-
6For ForkLift 3, the command is
defaults write -g NSFileViewer -string com.binarynights.ForkLift-3
Feb 25, 2017 at 12:35
Now as the ForkLift V3 came out, the new command should be:
defaults write -g NSFileViewer -string com.binarynights.ForkLift-3
At the same time, if you like to restore Finder to be the default file manager again, use:
defaults delete -g NSFileViewer
From Forklift official documentation:
If you are using ForkLift from Setapp, paste this command instead:
defaults write -g NSFileViewer -string com.binarynights.forklift-setapp; defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{LSHandlerContentType="public.folder";LSHandlerRoleAll="com.binarynights.ForkLift-3";}'
You can change default file manager like this, but ForkLift or Transmit not work as expected, only Path Finder are
#!/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);