Leverage Shortcuts to Quickly Copy Dropbox Share Link for Selected Finder Item or Frontmost Open Document

I'm sharing two KM macros and a Shortcut in this post:

GET DROPBOX LINK (SELECTED ITEM).kmmacros (3.3 KB)

GET DROPBOX LINK (FRONTMOST OPEN DOCUMENT).kmmacros (5.1 KB)

Shortcut: Get Dropbox Link (MAC)

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:

image

The second macro has these elements:

image

The "Get Dropbox Link" shortcut looks like this:

image

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.

Cheers!

5 Likes

Thanks. so much for this [these] macros. I have gotten both to work; however I cannot get the link to paste out anywhere but Apple Notes. Any Suggestions?
TIA
Wendy

I will take a look at it. If possible can you upload your macro in a reply to this message?

I have reviewed the macros. The output of the macros is to place a link on the clipboard. It does not paste, unless you've added a paste action. There is nothing that should restrict you from pasting the clipboard in any app on your system. If you have modified the macros in some way, let me know. Maybe try rebooting your computer?

I figured it out -- I didn't change it, I use "Paste" clipboard utility and I just need to "save" the link before it will past anywhere, so now I show it in a window and copy and paste it from there.
Thanks so much for your reply though. Love this Forum!