sfltool add-item (to add Finder favorite) stopped working on High Sierra
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..
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
An optional replacement is mysides, which I can confirm works just fine on Mojave. However it's not (yet) installable via Brew, so limited programmatically, but I'll be seeing if I can change that today.
Update: I went ahead and created a brew cask for it, which should suffice for making it completely "programmatic" once that is approved/merged.