canadaduane Posted February 6, 2013 Share Posted February 6, 2013 For any file in your Dropbox folder, this workflow shows the dropbox short link URL (e.g. http://db.tt/1LkWGVJF) and copies the link to the clipboard (Cmd+Shift+D): 1. Select a file in Finder (must be a file within your Dropbox folder, e.g. ~/Dropbox/Photos/MyPhoto1.jpg) 2. Press Command+Shift+D 3. Authorize the workflow to use the Dropbox API (only if this is the first time) 4. The shortened link pops up and is copied to the clipboard. It uses OAuth in the background to connect to Dropbox so you can authorize the Alfred 2 Workflow without storing passwords insecurely. For those who are interested, it starts a Ruby-based local web server using Sinatra which is then opened in the default browser. You can authorize the Dropbox app in your browser, and then the local server shuts itself down. Once authenticated, you don't need to do this step again. Once connected via OAuth, this workflow has the potential to do a lot of things with Dropbox, but currently only queries the dropbox service for shortened URLs. This method (using OAuth/dropbox) has the advantage that any file in your Dropbox folder can be shared, not just those in the "public" directory (a deprecated method of accessing dropbox files). The downloadable workflow itself is here (on dropbox, naturally): http://db.tt/1LkWGVJF http://db.tt/A3eZqMAr (new version, fixes direct linking to folders) And the github repository is here: https://github.com/canadaduane/alfred2-dropbox Duane maeltj, mlgill, sphardy and 4 others 7 Link to comment
Carlos-Sz Posted February 6, 2013 Share Posted February 6, 2013 The download is huge (compared to other workflows) with a lot of files. Is that right? Link to comment
sphardy Posted February 6, 2013 Share Posted February 6, 2013 Have been waiting for someone to build this workflow - thanks. One request - the flow returns only the short link. I'd sometimes prefer to not generate the short link (only 8 characters), but instead get the longer link. Would that be feasible? Thanks again Link to comment
canadaduane Posted February 7, 2013 Author Share Posted February 7, 2013 The download is huge (compared to other workflows) with a lot of files. Is that right? Yeah, it comes with several Ruby gems as well as images for the HTML "success" page. Some of it could probably be trimmed down, but in today's bandwidth I didn't think 3MB would be an issue. Link to comment
canadaduane Posted February 7, 2013 Author Share Posted February 7, 2013 Have been waiting for someone to build this workflow - thanks. One request - the flow returns only the short link. I'd sometimes prefer to not generate the short link (only 8 characters), but instead get the longer link. Would that be feasible? Thanks again Yes, the full URL is supported by the dropbox-api ruby gem. Maybe I could create a Command+Shift+Ctrl+D alternative for the full link? Link to comment
canadaduane Posted February 7, 2013 Author Share Posted February 7, 2013 Maybe I could create a Command+Shift+Ctrl+D alternative for the full link? Reload the original download and you should get a new Command+Shift+Ctrl+D hotkey for a direct URL link to the file. I also trimmed the file a bit, so it's under 2 MB now Duane Link to comment
sphardy Posted February 7, 2013 Share Posted February 7, 2013 Reload the original download and you should get a new Command+Shift+Ctrl+D hotkey for a direct URL link to the file. Fantastic - works fine and addresses my paranoia the short link could be guessed Link to comment
tconte Posted February 7, 2013 Share Posted February 7, 2013 Is there a way this could grab a link for folders as well? Thanks Link to comment
canadaduane Posted February 7, 2013 Author Share Posted February 7, 2013 Is there a way this could grab a link for folders as well? Thanks Good call. I hadn't noticed that the underlying dropbox-api library didn't offer support for this. I fixed it and sent a pull request to the original library. In the meantime, the workflow has been updated and re-downloading the link above should give you a version that supports getting links for folders as well. Duane sphardy 1 Link to comment
Allosunshine Posted February 7, 2013 Share Posted February 7, 2013 I get Only a limited set of users can receive access tokens while this app is in development mode. Any ideas? Link to comment
sphardy Posted February 7, 2013 Share Posted February 7, 2013 Good call. I hadn't noticed that the underlying dropbox-api library didn't offer support for this. I fixed it and sent a pull request to the original library. In the meantime, the workflow has been updated and re-downloading the link above should give you a version that supports getting links for folders as well. Duane It seems short links to folders are working, but not the full links - nothing is returned Link to comment
canadaduane Posted February 8, 2013 Author Share Posted February 8, 2013 I get Only a limited set of users can receive access tokens while this app is in development mode. Any ideas? I've applied for a "production" license for the app at Dropbox. I'm not sure what they'll do--I've never applied for one before. If you want to access it in the meantime, you can get your own development key for the app, and then replace the dropbox_app_key/dropbox_app_secret in the bundle_settings.yml file in the workflow's directory. Link to comment
canadaduane Posted February 8, 2013 Author Share Posted February 8, 2013 It seems short links to folders are working, but not the full links - nothing is returned Here's what I get in the Console.app log: Alfred Workflow[22033]: Creating a link for a directory is not allowed. (Dropbox::API::Error) [query: /Users/duane/Dropbox/Books] Link to comment
sphardy Posted February 8, 2013 Share Posted February 8, 2013 Here's what I get in the Console.app log: Alfred Workflow[22033]: Creating a link for a directory is not allowed. (Dropbox::API::Error) [query: /Users/duane/Dropbox/Books] Wow - how weird? Why would short links be OK but not the full links to which they redirect? Link to comment
canadaduane Posted February 8, 2013 Author Share Posted February 8, 2013 I've applied for a "production" license for the app at Dropbox. I'm not sure what they'll do--I've never applied for one before. If you want to access it in the meantime, you can get your own development key for the app, and then replace the dropbox_app_key/dropbox_app_secret in the bundle_settings.yml file in the workflow's directory. BTW, the workflow has been approved for "production" by Dropbox so as many people as would like to use it, should be able to now. I had to remove the dropbox icon from the workflow (at least for approval--my personal copy uses the logo anyway Here are the branding guidelines: https://www.dropbox.com/developers/reference/branding Here is the "approved" workflow with changed icon (also, renamed to "Dropbox Quick Links"): http://db.tt/A3eZqMAr Duane Link to comment
canadaduane Posted February 8, 2013 Author Share Posted February 8, 2013 Wow - how weird? Why would short links be OK but not the full links to which they redirect? Ok, I figured it out. The API library was asking for a "media" link in the case of direct URLs, and directories are not considered "media". The latest at http://db.tt/A3eZqMAr should fix it. Duane sphardy 1 Link to comment
sphardy Posted February 9, 2013 Share Posted February 9, 2013 Ok, I figured it out. The API library was asking for a "media" link in the case of direct URLs, and directories are not considered "media". The latest at http://db.tt/A3eZqMAr should fix it. Duane Quick test shows this appears to be fixed - thanks again Link to comment
andrewconner Posted February 10, 2013 Share Posted February 10, 2013 Any way non-Dropbox files could be copied to a configurable Dropbox directory? Being able to easily share any file would be pretty great. Thanks! Link to comment
phyllisstein Posted February 11, 2013 Share Posted February 11, 2013 Great work! This should come in very handy. Link to comment
Carlos-Sz Posted February 11, 2013 Share Posted February 11, 2013 Any way non-Dropbox files could be copied to a configurable Dropbox directory? Being able to easily share any file would be pretty great. Thanks! I made a workflow that moves a file to Public folder and then copies the URL: [Workflow] Move selected Finder file to Dropbox + URL to clipboard Link to comment
raguay.customct Posted February 12, 2013 Share Posted February 12, 2013 Hi, I am running two different copies of Dropbox (one personal, one for work). Is there a way for this to support both of them? I use this functionality a whole lot and this workflow will make it much easier. Thanks! Link to comment
canadaduane Posted February 12, 2013 Author Share Posted February 12, 2013 Any way non-Dropbox files could be copied to a configurable Dropbox directory? Being able to easily share any file would be pretty great. Thanks! It's certainly possible. I think to do it right, we'd need a configuration page or something... some way to indicate where to send the files. And while we're at it, probably an option to copy vs. move them. Link to comment
canadaduane Posted February 12, 2013 Author Share Posted February 12, 2013 Hi, I am running two different copies of Dropbox (one personal, one for work). Is there a way for this to support both of them? I use this functionality a whole lot and this workflow will make it much easier. Thanks! How do you have 2 Dropbox copies installed? Or rather, how does Dropbox itself differentiate between the two? I currently use the value stored in ~/.dropbox/host.db to know where the "Dropbox" folder is located on the hard drive. When there are 2 copies of Dropbox installed, where does the 2nd copy store information about itself? A folder other than ~/.dropbox/? Link to comment
raguay.customct Posted February 12, 2013 Share Posted February 12, 2013 Hi, I created a directory "Dropbox-envato" and start a new instance of DropBox using the environment set to the new directory. I created a simple workflow to launch that special instance. Once it is running, I change the preferences for that Dropbox to black so that I can tell which one is for which. Therefore, the workflow would need to access those different dropbox directories. Link to comment
graphorce Posted March 19, 2013 Share Posted March 19, 2013 (edited) This has been working flawlessly for me, just one thing, is there a way to get a shortened link for those 'direct links' too? Something like http://db.tt/A42fai2 instead of https://dl.dropbox.com/1/view/9p8436cit2jlmvg/Public/Comps/24125.png ? Thanks a lot! Edited March 19, 2013 by graphorce Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now