Add folder to sidebar from Terminal

1

1

I want to know how put some /my/folder/path/ to Sidebar in Favorites or Devices section, from terminal?

Chepe Questn

Posted 2017-12-11T21:18:39.010

Reputation: 173

Answers

2

Per this GitHub page, a tool named sfltool can be used to add favorites. The tool is included with macOS El Capitan and later.

Example usage

/usr/bin/sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///my/folder/path/

davidmneedham

Posted 2017-12-11T21:18:39.010

Reputation: 1 724

It's not working now. There's not official tool for slf2. – fxp – 2018-10-13T09:37:38.173

1

The add-item capability of sfltool has now been removed since 10.13 and going forward. So that's no longer an option.

An easier to use alternative is mysides, which can easily by installed via Homebrew Casks:

$ brew cask install mysides
$ mysides add example file:///Users/Shared/example

James

Posted 2017-12-11T21:18:39.010

Reputation: 351

This worked for me on Mojave. – bearvarine – 2019-09-21T15:20:32.417

0

I used the mysides tool to create a link to the Trash folder on my sidebar. You will need admin (or sudo) permissions to install mysides.

$ brew cask install mysides
==> Satisfying dependencies
==> Downloading https://github.com/mosen/mysides/releases/download/v1.0.1/mysides-1.0.1.pkg
==> Verifying SHA-256 checksum for Cask 'mysides'.
==> Installing Cask mysides
==> Running installer for mysides; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
Password:
installer: Package name is mysides-1.0.1
installer: Installing at base path /
installer: The install was successful.
  mysides was successfully installed!

$ mysides add Trash file:///Users/bearvarine/.Trash
Added sidebar item with name: Trash

bearvarine

Posted 2017-12-11T21:18:39.010

Reputation: 101

0

Another option could be using Python to create a script with the PyPi package finder-sidebar-editor and call it from the terminal.

Would be something like:

from finder_sidebar_editor import FinderSidebar

sidebar = FinderSidebar()
sidebar.add("/my/folder/path/")

Ajordat

Posted 2017-12-11T21:18:39.010

Reputation: 1