7

When we open Dropbox folder, we can see icon on the left bottom of the folder.

Dropbox badges

I am developing an application in which i also want the same behavior. If folder is syncing then it will show sync icon and for other operation it will show other icon. The marked files/folder when viewed in Finder must be shown with a custom icon. But when they are selected for preview ( using spacebar) they must show their original icon ( i.e the blue icon for folder etc) .

enter image description here

pkamb
  • 33,281
  • 23
  • 160
  • 191
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144
  • Have you implemented like that? – jigs May 18 '15 at 12:37
  • Ohh thats great..have you used Finder Sync? – jigs May 18 '15 at 13:16
  • How did you did that? Can you please provide any reference link or Sample demo link for doing this? From so many days i m trying to implement that using Finder Sync from apple’s official document but do not succeed till now. Any help is appreciated..! – jigs May 18 '15 at 13:59
  • Everything is there in apple developer document. You can search on developer forum for sample code. – Parag Bafna May 24 '15 at 12:48
  • @jigs Have a look at [FinderSync](https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/Finder.html#//apple_ref/doc/uid/TP40014214-CH15-SW1) – Parag Bafna May 25 '15 at 11:06
  • You can find some hints here: http://stackoverflow.com/a/43183393/4000846 – Prasanna Apr 03 '17 at 11:30

4 Answers4

8

Starting with Yosemite (10.10), there is now an officially supported (and thus Mac App Store compatible) method for displaying sync status badges in Finder icons in the form of Finder Sync extensions.

pkamb
  • 33,281
  • 23
  • 160
  • 191
Pierre Lebeaupin
  • 1,103
  • 8
  • 20
5

Dropbox has developed a NSPlugin for showing icon badges on each folder/file. As you would know, NSPlugins for Finder were deprecated by Apple starting with Snow Leopard. I think Dropbox worked around it with a hack - that reenabled plugin support. I don't think Apple would have liked that. Apple wants third party apps to only provide services support, since they don't want any third party code in Finder's process, but services are underwhelming.

2

In addition to the Finder Sync Extension mentioned in other answers, badges (and other metadata) on files can additionally be accomplished via the File Provider API:

File Provider

An extension other apps use to access files and folders managed by your app and synced with a remote storage.

https://developer.apple.com/documentation/fileprovider

Specifically, the NSFileProviderItemDecorating class:

Badge
The system displays the badge image on top of the item’s icon. It only displays the first Badge image.

FolderBadge
Only available on folder items. The system embosses the image over the folder icon. It only displays the first FolderBadge image.

pkamb
  • 33,281
  • 23
  • 160
  • 191
0

This can be achieved by creating new Finder Sync Extension. Find more information here: https://stackoverflow.com/a/43183393

Prasanna
  • 49
  • 3