Skip to content

Instantly share code, notes, and snippets.

View prashantvidja's full-sized avatar
😉
Focusing

Prashant Vidja prashantvidja

😉
Focusing
  • Rajkot,Gujarat
View GitHub Profile
@prashantvidja
prashantvidja / fav_servers.py
Created February 12, 2019 06:00 — forked from pudquick/fav_servers.py
Modifying the Favorite Servers list (in Finder's "Connect to Server" dialog) on OS X 10.11, a revisit of my blog post at: http://michaellynn.github.io/2015/10/24/apples-bookmarkdata-exposed/
import os.path
from Foundation import NSData, NSKeyedUnarchiver, SFLListItem, NSURL, NSMutableDictionary, NSKeyedArchiver, NSString, NSDictionary, NSArray
def load_favservers(sfl_path):
if os.path.isfile(sfl_path):
# File exists, use it
sfl_decoded = NSKeyedUnarchiver.unarchiveObjectWithData_(NSData.dataWithContentsOfFile_(sfl_path))
else:
# File doesn't exist, make a blank template
sfl_decoded = {u'items': [],