Managing Finder Sidebar items on HighSierra

ChupSuy
New Contributor III

Hi folks,

I'm trying to remove certain items such as the entire section Device & Shared from the Finder Sidebar. just like in screenshot attached.. 7d6bd67070bf4fc0b19f0b2d8148cfc7

Anything I found so far using a DMG with "FUT/FEU's" options, or even MCX or plist editing seems not to do the needed.

Also I figured, even after changing the options through GUI Finder --> Preferences --> Sidebar, the actual com.apple.sidebarlists.plist remains unchanged. The only plist changing is com.apple.finder.plist

Am I missing anything? or has it simply become impossible to manage these items?

12 REPLIES 12

timlarsen
Contributor

@ChupSuy I don't know if I've explicitly tried this on an out-of-the-box 10.13 Mac yet, but as part of my Finder/Sidebar preference policy I run this command afterwards (might be worth a shot):

USERNAME=`who | grep console | awk '{print $1}'`; su $USERNAME -c 'killall cfprefsd'; su $USERNAME -c 'killall Finder'

Good luck!

blackholemac
Valued Contributor III

Strangely right now I am literally trying to do the same as @ChupSuy with the only difference being that I want to add something to the sidebar. I found your answer in the form of someone else's GitHub:

https://github.com/mosen/mysides

You have to compile it in Xcode, but I just attempted using it and its ridiculously easy to use once installed on a machine:
simply type 'mysides list' to see everything in the sidebar. Then type 'mysides remove Applications' and this entry is magically gone.

Kudos to the developer of this.

timlarsen
Contributor

Cool find @blackholemac !

blackholemac
Valued Contributor III

It was a good find, BUT I’m troubled by use of deprecated frameworks.

https://github.com/mosen/mysides/issues/14

I can confirm the compiled tool works on 10.13.2, BUT when I deploy a new tool to my ecosystem, I tend to worry about a product that relies on deprecated frameworks.

In my case I just want to add the OneDrive - (my org) folder to the default saving locations on a given random app’s save sheets. I know that putting a folder onto the sidebar achieves this. Looking for other ideas.

ChupSuy
New Contributor III

I just can't get this to work it seems.. I compiled and checked on the mysides binary but that only seems to work on the "Favourites" section..

I must get removed the "Devices" and "Shared" sections...

So I come up with the script below but it just does not remove the stuff from the Finder Sidebar.. :/ oh what a pita..

#!/bin/bash
# Get the Username of the currently logged user
loggedInUser=`/bin/ls -l /dev/console | /usr/bin/awk '{ print $3 }'`

# Shared section
/usr/libexec/PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.backToMyMacEnabled bool False" /Users/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist
/usr/libexec/PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.bonjourEnabled bool False" /Users/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist
/usr/libexec/PlistBuddy -c "Add :networkbrowser:CustomListProperties:com.apple.NetworkBrowser.connectedEnabled bool False"  /Users/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist

su $loggedInUser -c 'killall cfprefsd' && su $loggedInUser -c 'killall Finder'

is there anyone out there who has a working example on 10.13.2?

PeterClarke
Contributor II

Hi, - No as i have not tried to program this I don't have any example code to share on this.

But I do know why your code is NOT working..

The answer is: that basically it 'should work' - except that if there is a 'cached version' available, (i.e. the 'old' version),
then that is automatically used.

What you need to do is somehow flush the cache - fortunately that's very easy to do..
PlistBuddy is jolly useful - but it's NOT cache aware..
Where as 'defaults' IS cache aware...

Also having done your stuff with PlistBuddy, add something like the following line of code.

sudo defaults write /User/$loggedInUser/Library/Preferences/com.apple.sidebarlists.plist -bool Updated 'Yes'

(you can actually write anything (that's plist legal) either a 'true property' or just make one up...
e.g.: -bool UpdatedByMe Yes

The 'act' of the 'defaults' tool writing to the plist automatically also flushes the cache for that item..
So now your modifications will be read - and provided that they make sense, they should work.

The fact that this plist does not normally have a property called "UpdatedByMe" does not matter - it will just be ignored
Here we are actually only after 'defaults' ability to flush the cache for that item.

  • Hope that helps..

L3nny5
New Contributor III

Did this work for anybody (last 2 comments)? Having a freshly installed 10.13.3 Mac, there is no com.apple.sidebarlists.plist on the system.
Any ideas or solutions which may help removing other items like Backtomymac or adding Harddrive or name of the Mac in the devices section?

criebrie2
New Contributor

I'm sure someone will have a more efficient way of managing this but the new sidebar file location lives here:

~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.FavoriteItems.sfl

After setting the preferences the way I want it, copied it to the Default User folder.

JoshRouthier
Contributor

@blackholemac Looking to do pretty much exactly what you mentioned above. Did you ever find a tool that didn't rely on deprecated frameworks? I'd rather not invest the time and energy into a tool that I'll just have to replace in 6-12 months because Apple finally removes the frameworks the tool relies on.

MacGeek
New Contributor III

criebrie2,

Did your solution work? Did you try FUT and FEU to install for everyone?

a_westermeyer
New Contributor

Hi ! I was wondering if a solution to manage sidebar items in High Sierra / Mojave had been found ?

scerazy
New Contributor III

3 posts above? Works for me ever since