17

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?

penguinrob
  • 3,342

4 Answers4

13

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.

jtbandes
  • 11,074
3

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
3

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";}'
anki
  • 11,753
baqx0r
  • 31
0

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);
diimdeep
  • 1,094