I'm sharing two KM macros and a Shortcut in this post:
The two macros allow me to quickly (i.e., via keyboard shortcut) grab Dropbox share links without having to right click on a Finder item located in Dropbox. The first macro gets a share link from a single item selected in Finder, within the Dropbox folder. The second macro gets a share link to the frontmost open document. (Make sure the open document has been saved before firing the macro!)
Both macros leverage Shortcuts' Dropbox functionality to get a share link from the filepath of the selected item/open document.
The second macro uses @ccstone's awesome script to grab the filepath of the frontmost open document. See: Finding the File Path for the Front Document in the Front Application. Thanks again, Mr. Stone!
Note that the "Get Dropbox Link" shortcut, below, works with any intra-Dropbox filepath in the clipboard. Think of the possibilities!
The first macro has these elements:
The second macro has these elements:
The "Get Dropbox Link" shortcut looks like this:
Pretty simple. Pretty freakin' useful!
Note that the "Get Dropbox File" action in Shortcuts requires that the filepath start with the name of the first parent folder whose parent folder is the main Dropbox folder. Thus, the KM macros strip out the "/Users/YOUR HOME DIRECTORY/Dropbox" portion of the filepath in the clipboard before executing the shortcut. You will need to insert the name of your home directory in the "STRIP" KM actions before using these macros.
These macros are uploaded in disabled state and do not have hotkeys assigned.