adding folder to favorites in finder

Heres one for OSX experts, is there a way in Xojo to link a folder to the favorites bar in finder? the same way dropbox does it.

I found this :

As one of the participants says in the discussion "Dropbox is using undocumented magic. "…

Undocumented magic and reverse engineering are secrets well kept by wizards :wink:

I tried to use Automator to record adding an icon to a finder toolbar. Does not work.

Maybe AppleScript can do that ; unfortunately I know too little about it to program the alt-command drag and drop required. Maybe another member ?

Reverse engineering, horrible hacks, and other things that shouldn’t be done in shipping software.