I copy download links all day from the Mac Finder. It would be great to assign a key command so that you can highlight a file in your Dropbox via Mac Finder, and press a key command to copy the link instead of right clicking.
Update (2023-01-17)
I've moved the script to a repository and expanded on the instructions.
I wanted this now, so I wrote a Python script to get the URL from the command line and created an Automator QuickAction that calls the script with the selected file(s) in Finder:
Now, ^⌘L copies the Dropbox URL of any number of files selected in the Dropbox folder.
I agree Justin
I'd love this.
Bumping this! So needed
This idea is going to need a bit more support.
We've updated the status to encourage more users to back you up!
Bump. Please.
Hey – it's 2021. We need this.
Bump. Please. It's almost 2022
Would really love to see this as it would also allow hotkey integration with different tools (I.E. a button on my mouse).
Signed up to vote for this! The contextual menu items should just be exported as services by the Dropbox app. Then they'd appear in Finder's Services menu and users would be able to assign shortcuts using System Preferences > Keyboard > Shortcuts.
Keyboard shortcuts and touchbar integration would really be a big improvement
@Gene_Parmesan thanks for creating that script - I did all the steps but it results in error when I run it - any thoughts or can you help!?
Possibly, but I'd need to see the error.
@Gene_Parmesan I've been searching all over for something like this -- thank you!! I've followed all the steps in your screenshots and GitHub, but I'm getting the following error when I run the Quick Action: "ERROR: file isn't in the Dropbox folder". I see where this error is returned in your code, but I'm not fluent enough to understand what causes it. Any thoughts?
@Gene_Parmesan perhaps you could give us non-coders a step-by-step how to implement your solution?
My guess is that your Dropbox folder is not at ~/Dropbox. I've changed the script to fetch the path of the Dropbox folder in your home directory from ~/.dropbox/info.json. However, there can be two paths there: one for personal Dropbox accounts and one for business accounts. The script only looks for personal accounts, but you can change that to 'business' on line 42 if necessary. (See more about info.json.) You need to use the account which the TOKEN is attached to.
I've also added a more descriptive error message when the path calculation fails. Hopefully that will give you enough clues as to what has gone wrong. Let me know if it works now!
@Gene_Parmesan I use a Dropbox business account, and changing 'personal' to 'business' on line 42 did the trick! I've been dreaming of this functionality for a long time -- thank you!!!
Great to hear! I've tweaked the script slightly to call out the personal/business dichotomy more clearly, and updated my earlier comment to take account of the new line numbers. Enjoy your new Finder keyboard command! 😄
I would die to know how to create this shortcut for Windows!!!
would anyone help me to make it work? please? I've done almost all steps but am stacked now...it did not finds the py file on the bin folder...I'm not sure it there to be fair. hahaha
Yes, you have to put the script in a bin folder in your home directory. Follow the instructions in the comment below the script to get it set up.
Another alternative is to buy BetterTouchTool and assign the Trigger Context Menu Item action to a keyboard shortcut in Finder.
@Gene_Parmesan I've been using your script for a few months now and it's such a game changer — thank you!! I've noticed two quirks that I thought I'd share, in case you see any obvious solutions:
In any case, grateful to you for putting this together!
thanks! I'll try this!
the thing is, I'm trying to find a way where I don't need to point my mouse at the file....only the keyboard highlight wold be enough...
I don't think it's possible to fix either problem, unfortunately @dhermanq. If the API can't find the file to create a shared link with (presumably because it's not yet fully uploaded), then that error makes sense. As to why it works when using the contextual menu item, I have no idea. Perhaps they're using another method which is unavailable to the Dropbox Python API. And the speed thing is unfortunate, but kind of comes with the territory of Automator/AppleScript. 😞
And @mbiaso you're right, I forgot that the BTT action uses the location of the cursor, not the Finder selection. You have to use Automator to get that, which means you're back using my script. So follow the setup instructions and hopefully it will work for you.
Would love this feature, think it will benefit al lot of workflows for people!
thank you, this is so handy!
Hi @Gene_Parmesan,
Migrate your code to use refresh token (together with the access one). Otherwise your script users will need access token update by hands quite often. Also cache the access token and wipe out all calls not related to the link receiving to speed up the process (every call - meaningful or not - takes time).
This doesn't really sense to me... I downloaded the script... no idea what to do with it... I tried to do the whole automation thing, but also don't know what to do with that... so just got dead-end and dead-end and dead-end... Surely by now DropBox would have done something around this... I use Copy Dropbox link anywhere from 10–100 times per day... honestly getting tired of right clicking (on a track pad) 10–100 times per day 😓