File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from Foundation import NSBundle
88from LaunchServices import kLSSharedFileListFavoriteItems
99from objc import loadBundleFunctions , initFrameworkWrapper , pathForFramework
10+ from CoreServices import LSSharedFileListCreate , kLSSharedFileListFavoriteItems , LSSharedFileListInsertItemURL
1011
1112os_version = int (mac_ver ()[0 ].split ('.' )[1 ])
1213if os_version > 10 :
@@ -186,11 +187,12 @@ def remove_by_path(self, path):
186187 """
187188 comparison_path = f'file://{ path } /' .upper ()
188189 for item in self .snapshot [0 ]:
189- sidebar_item = LSSharedFileListItemCopyResolvedURL (item , 0 , None )
190- if comparison_path == str (sidebar_item [0 ]).upper ():
190+ sidebar_item = LSSharedFileListItemResolve (item , 0 , None , None )
191+ if comparison_path == str (sidebar_item [1 ]).upper ():
191192 LSSharedFileListItemRemove (self .sflRef , item )
192193 self .synchronize ()
193194 self .update ()
195+
194196
195197 def add (self , to_add , uri = "file://localhost" ):
196198 """
You can’t perform that action at this time.
0 commit comments