You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Justin P.2
9 years agoCollaborator | Level 10
Key Command/Shortcut to "Copy Dropbox Link" from Mac Finder.
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 ...
- 4 years ago
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.
markcq
Helpful | Level 5
Unfortunately none of the suggestions work for me, because you lose me at:
"I had initially installed pip3 install dropbox (the module) as your README.md instructed."
What does that mean for a non-programmer? To be honest, the whole story is so convoluted that I get a headache just trying to read the instructions. So I manually right click on each item and copy the dropbox link (which I have to do many times per day)... Why is it so complicated for DB to just make a keyboard shortcut?
dropboxWhy is there not an option for this in System Preferences → Keyboard → Shortcuts → Services? Then we can make our own shortcut...
Gene_Parmesan
2 years agoCollaborator | Level 8
I've spent a bit more time with this and I think I've resolved the Python and Automator issues. Please see the new instructions in the repo README, and let me know if there are any further problems! dhermanq porg Note that I have fixed a problem with duplicate links caused by an unneeded "Get Selected Finder Items" action.
I've added threading too. Now even relatively large sets of links can be generated efficiently. There are 10 workers by default, hopefully that will strike a good balance between speed and keeping on the right side of any rate limits on Dropbox's API.
- dhermanq2 years agoHelpful | Level 6
Gene_Parmesan thanks for the additional help on this! I've made some progress with the new script and instructions. I took your suggestion to pin urllib3 to version 1.26.6, and that allowed me to generate the API access code. However, now when I try running my Automator workflow I get the following error:
The action “Run Shell Script” encountered an error: “usage: get_dropbox_link.py [-h] [--verbose] paths [paths ...]
get_dropbox_link.py: error: the following arguments are required: paths” in macro “Copy Dropbox Link”Would this have something to do with the fact that either a) I use a Dropbox business account (I've changed the AccountType variable in your script accordingly), or b) I keep my Dropbox files on a removable drive, and not the standard ~/Dropbox path?
I do appreciate for all the thought and attention you've put into this thus far!
- Gene_Parmesan2 years agoCollaborator | Level 8
Ack, that's my error! It should be "$@" like you had it, I'm sorry. Please change it back.
Just to be clear, when you're getting this error, are you pressing Run within Automator? If so, that won't work. You need to do the next steps to set up the Finder keyboard shortcut. That way the Workflow will be run as a Quick Action via the Services menu and thus have selected files in Finder to pass into the Quick Action.
- dhermanq2 years agoHelpful | Level 6
Gene_ParmesanSuccess! Previously I had been using a Keyboard Maestro macro to run the Automator workflow, but I've just tried triggering it from the services menu with a keyboard shortcut, and voila! It works!
I'm curious how the two methods differ. I had used KM to run your previous version of the script without any trouble. In any case, this method works great and the link seems to be generated much much quicker than before! A massive improvement -- thank you again for this!!
- Gene_Parmesan2 years agoCollaborator | Level 8
Huzzah! So glad we got there in the end, thanks for helping me debug the script, LOL. And I'm really pleased to hear it's faster now!
My guess is that the difference comes from this version of the workflow requiring Finder items to be passed in at the top. Previously, I was using a Get Selected Finder Items action, which was resulting in links being duplicated given the "Workflow receives files from Finder" preamble. But if you add back that Get Selected Finder Items action and then go back to using KM (and I presume set the workflow to receive "no input", since that's how you'd now be using it)… I think it would work that way as well. You can read up on this a bit on AskDifferent.
I'd be interested to hear if my hypothesis is correct. 😀 I had assumed these two approaches were completely equivalent, but perhaps using an action is actually more flexible.
- dhermanq2 years agoHelpful | Level 6
That was it! When I restored "Get selected item from Finder" and changed the input to none, my Keyboard Maestro macro worked. But after a quick and dirty test, it looks like it's just a hair faster to run the workflow as a service, so I'm going to keep it that way after all.
Thanks Gene_Parmesan !!
- Gene_Parmesan2 years agoCollaborator | Level 8
Great, glad we could lay that mystery to rest. Yeah, I'm not surprised that it's faster via the Services menu. As far as I understand it, having that extra Workflow step means another AppleScript invocation, and AppleScript is notoriously sluggish.
- dhermanq2 years agoHelpful | Level 6
Gene_Parmesanthe update did the trick! Thank you!!
- Gene_Parmesan2 years agoCollaborator | Level 8
You're almost there! This output means that the script IS running successfully, but it's not receiving the list of selected paths. My guess is that you are passing input "to stdin" instead of "as arguments". Either that, or your script in the Automator action doesn't have "$0" after it. Might either of these be the culprit?
Or what about "Workflow receives current files or folders in Finder"?
- dhermanq2 years agoHelpful | Level 6
Gene_ParmesanI had used "$@" in the automator script per the instructions and the Automator workflow you posted. I tried switching that to "$0" instead, but now I get a slightly different error:
2023-05-24 16:08:45 !ActionCanFail() for Action Execute “Get Dropbox Link.workflow” Automator Workflow in macro Copy Dropbox Link with failure Execute an Automator Workflow failed with script error: The action “Run Shell Script” encountered an error: “ERROR:root:'/Users/dherman/-' is not in the subpath of '/Volumes/STUDIO D DROPBOX/Good Studio Dropbox/David Herman' OR one path is relative and the other is absolute.”
2023-05-24 16:08:45 Action 441 failed: Execute an Automator Workflow failed with script error: The action “Run Shell Script” encountered an error: “ERROR:root:'/Users/dherman/-' is not in the subpath of '/Volumes/STUDIO D DROPBOX/Good Studio Dropbox/David Herman' OR one path is relative and the other is absolute.”
2023-05-24 16:08:45 Execute an Automator Workflow failed with script error: The action “Run Shell Script” encountered an error: “ERROR:root:'/Users/dherman/-' is not in the subpath of '/Volumes/STUDIO D DROPBOX/Good Studio Dropbox/David Herman' OR one path is relative and the other is absolute.” in macro “Copy Dropbox Link” (while executing Execute “Get Dropbox Link.workflow” Automator Workflow).I'm attaching a screenshot of my Automator workflow below. It looks like I do have Pass inputs set to "as arguments."
My Dropbox Volume name has spaces in it — could that be part of the issue?
- dhermanq2 years agoHelpful | Level 6
I should clarify, that screenshot is of my original workflow, before I changed the script to "$0"
About View, download, and export
Need support with viewing, downloading, and exporting files and folders from your Dropbox account? Find help from the Dropbox Community.
Need more support
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!