Jump to content

Using Marta (or an alternative Finder app) with Alfred


Recommended Posts

Marta is a recently developed file manager for macOS that's oriented for power users. It's very keyboard oriented, and is sort of the finder version of SublimeText if that means anything to you. 

 

I was wondering if there was a way to get Alfred to open folders via Marta instead of the default Finder app. I know that in some cases like for PathFinder (another popular finder alternative) it's not necessary to do much and I think Alfred opens up the folder automatically in Pathfinder. Is there a way to do it with Marta or any other alternative? 

Link to comment

Alfred uses the default file browser from your Mac. Finder is the default, but some alternatives (like Path Finder) add a preference to set them as the default file browser (taking the place of Finder). Therefore, to do what you want, it's not really related to Alfred, but to your computer configuration.

 

You can set Marta as the default file browser with the command (inserted into the Terminal):

defaults write -g NSFileViewer -string org.yanex.marta;

And revert to Finder with this command (if you want to switch back):

defaults delete -g NSFileViewer

 

* Note that you would need to restart you computer to make the preference active.

 

Alternatively, if you don't want to change your computer preferences, you can specify an application to open the folder from the Alfred File Actions menu. When you are selecting a folder from Alfred, just press your File Actions key (the one(s) that you've defined in the Alfred preferences) and use "Open With" action and select the Marta application and it should open your folder in Marta.

Edited by GuiB
Adding alternative with File Action
Link to comment

@bivalvegruff, did you restart your computer or session?

 

If you write in terminal defaults read -g NSFileViewer you get org.yanex.marta as output?

 

Myself, I'm always opening the files using the Reveal in Finder action (CMD+Enter on a standard search or with the Reveal in Finder file action) and it works great on my side. However, if you open your file using only Enter while doing the file search then it seems that you need to also set another preference to Marta like:

 

defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{LSHandlerContentType="public.folder";LSHandlerRoleAll="org.yanex.marta";}'

This is all the same as what is explained at the Forklift website, so you can have a look here to have some more info: https://binarynights.com/manual#fileviewer

 

Hope this helps!

Link to comment

@GuiB I did restart my computer. defaults read -g NSFileViewer gives output:

The domain/default pair of (kCFPreferencesAnyApplication, NSFileViewer) does not exist

I ran that other command, restarted, and now it works when I open a directory only with Open, but it doesn't work with Reveal in Finder. Still get the output above though. Good enough for me! Thanks!

Link to comment

@bivalvegruff, the output you wrote means that the preference is not set on you computer, you should see an output that only mention: org.yanex.marta

 

Did you sent the second command as well? ( defaults delete -g NSFileViewer ) This one is meant to be use if you want to revert back to Finder and should then give the output that you have now when writing defaults read -g NSFileViewer . You can try again with the first command only ( defaults write -g NSFileViewer -string org.yanex.marta; )

 

Here is what I get on my side in the Terminal:

$ defaults write -g NSFileViewer -string org.yanex.marta;
$ defaults read -g NSFileViewer
org.yanex.marta

 

Edited by GuiB
Link to comment
  • 3 years later...
On 3/6/2019 at 1:19 PM, GuiB said:

@bivalvegruff, did you restart your computer or session?

 

If you write in terminal defaults read -g NSFileViewer you get org.yanex.marta as output?

 

Myself, I'm always opening the files using the Reveal in Finder action (CMD+Enter on a standard search or with the Reveal in Finder file action) and it works great on my side. However, if you open your file using only Enter while doing the file search then it seems that you need to also set another preference to Marta like:

 

defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{LSHandlerContentType="public.folder";LSHandlerRoleAll="org.yanex.marta";}'

This is all the same as what is explained at the Forklift website, so you can have a look here to have some more info: https://binarynights.com/manual#fileviewer

 

Hope this helps!

 

Is there a way to rollback the above command to remove `LSHandlerContentType="public.folder"` thing?

 

Edited by Lexyz
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...