Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Justin P.2
10 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 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.
67 Replies
Replies have been turned off for this discussion
- porg3 years agoHelpful | Level 5
Correction:
Justin P.2thanks for raising this.
Gene_Parmesan thanks for the script to prove it's possible.
- dhermanq3 years agoHelpful | Level 6
Gene_Parmesanthis is exciting! I've finally had the chance to try out the new version, starting from scratch with your instructions on GitHub. I've gotten to Step 12 (Call the script once and follow the instructions to get a refresh token the first time), however when I run the script from Terminal I get the following result:
Traceback (most recent call last):
File "/Users/dherman/bin/get_dropbox_link.py", line 37, in <module>
import dropbox
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/dropbox/__init__.py", line 3, in <module>
from dropbox.dropbox_client import ( # noqa: F401 # pylint: disable=unused-import
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/dropbox/dropbox_client.py", line 18, in <module>
import requests
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py", line 38, in <module>
raise ImportError(
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3. See: https://github.com/urllib3/urllib3/issues/2168I tried moving forward with your instructions and created an Automator workflow to run the script, then used Keyboard Maestro to trigger it. This is the result:
Shell Script” encountered an error: “Traceback (most recent call last):
File "/Users/dherman/bin/get_dropbox_link.py", line 37, in <module>
import dropbox
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/dropbox/__init__.py", line 3, in <module>
from dropbox.dropbox_client import ( # noqa: F401 # pylint: disable=unused-import
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/dropbox/dropbox_client.py", line 18, in <module>
import requests
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py", line 38, in <module>
raise ImportError(
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3. See: https://github.com/urllib3/urllib3/issues/2168”
2023-05-19 14:43:26 Action 441 failed: Execute an Automator Workflow failed with script error: The action “Run Shell Script” encountered an error: “Traceback (most recent call last):
File "/Users/dherman/bin/get_dropbox_link.py", line 37, in <module>
import dropbox
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/dropbox/__init__.py", line 3, in <module>
from dropbox.dropbox_client import ( # noqa: F401 # pylint: disable=unused-import
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/dropbox/dropbox_client.py", line 18, in <module>
import requests
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py", line 38, in <module>
raise ImportError(
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3. See: https://github.com/urllib3/urllib3/issues/2168”
2023-05-19 14:43:26 Execute an Automator Workflow failed with script error: The action “Run Shell Script” encountered an error: “Traceback (most recent call last):
File "/Users/dherman/bin/get_dropbox_link.py", line 37, in <module>
import dropbox
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/dropbox/__init__.py", line 3, in <module>
from dropbox.dropbox_client import ( # noqa: F401 # pylint: disable=unused-import
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/dropbox/dropbox_client.py", line 18, in <module>
import requests
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/requests/__init__.py", line 43, in <module>
import urllib3
File "/Users/dherman/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py", line 38, in <module>
raise ImportError(
ImportError: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with LibreSSL 2.8.3. See: https://github.com/urllib3/urllib3/issues/2168” in macro “Copy Dropbox Link” (while executing Execute “Copy Dropbox Link” Automator Workflow).I'm a bit out of my depth as to what this all might mean -- if you have any thoughts they would be welcome and appreciated!
- Gene_Parmesan3 years agoCollaborator | Level 8
Thanks for giving the updated script a try, dhermanq, sorry it’s not working for you. 🤔 Porg is having a similar issue, so clearly the instructions could use some refinement.
There are several suggestions in this Stack Overflow issue. Because I’m not able to reproduce the issue, I fear it will be up to you to do the actual troubleshooting, but do report back if you find something that works.
The first thing I’d try would be to install Dropbox this way:python3 -m pip install dropbox - markcq3 years agoHelpful | 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?
dbox_Why is there not an option for this in System Preferences → Keyboard → Shortcuts → Services? Then we can make our own shortcut...
- Gene_Parmesan3 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.
- dhermanq3 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_Parmesan3 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"?
- dhermanq3 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?
- dhermanq3 years agoHelpful | Level 6
I should clarify, that screenshot is of my original workflow, before I changed the script to "$0"
- Gene_Parmesan3 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.
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.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
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, Facebook or Instagram.
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!