Sfltool add-item (to add Finder favorite) stopped working on High Sierra

command linefinderhigh sierraterminal

I just noticed my normal command line command to add an item to Finder's favorites doesn't work anymore.

E.g. to add the Desktop to Finder's sidebar, I used to do:

sfltool add-item com.apple.LSSharedFileList.FavoriteItems file:///Users/MyUserName/Desktop && killall Finder

However, now, it seems it doesn't do anything anymore except showing the output:

Usage: sfltool archive|list-info|list [options]

I also noticed that the file extension of ~/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.FavoriteItems has changed from .sfl to .sfl2.

Does anyone yet know how to programmatically add a favorite item to Finder's sidebar in macOS High Sierra?

PS: I did find some solutions using a Swift script, yet I'd rather be able to just use a simple command line tool as before..

Best Answer

Apple officially killed it :(

Apologies, we do not plan to add back the feature. You will need to write a tool that does what’s needed.

https://openradar.appspot.com/radar?id=4985135170584576