Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Dropbox adds menu item to Finder's context menu?

Tags:

macos

cocoa

I have read many answers on similar questions but all suggest that they are no longer possible. I have OSX 10.9 and see Dropbox managing to do that.

Dropbox demo

Above screenshot is Finder's context menu. How to add menu items to Finder's context menu as shown above?

like image 544
AppleGrew Avatar asked Oct 02 '22 00:10

AppleGrew


1 Answers

While an old question, I recently had the same question and after a bit of digging I discovered that Dropbox is currently using Finder Sync, which appears to have a feature set perfect for what Dropbox does.

See the documentation here: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/Finder.html

garcon.appex inside Dropbox.app is the Finder Sync extension based on the contents of the Info.plist in the appex package:

<key>NSExtension</key>
<dict>
        <key>NSExtensionAttributes</key>
        <dict/>
        <key>NSExtensionPointIdentifier</key>
        <string>com.apple.FinderSync</string>
        <key>NSExtensionPrincipalClass</key>
        <string>EFFinderExtension</string>
</dict>

From the documentation:

With a Finder Sync extension you register one or more folders for the system to monitor. Your Finder Sync extension then sets badges, labels, and contextual menus for any items in the monitored folders. You can also use the extension point’s API to add a toolbar button to the Finder window or a sidebar icon for the monitored folder.

like image 135
ReenignE Avatar answered Oct 13 '22 12:10

ReenignE