File syncing tool Dropbox is one of our favourite tools for sharing files over the internet. Instead of opening your browser to find the public link to a file, though, you can copy it to your clipboard instantaneously with a Quicksilver action.
To share a file over Dropbox, you just need to copy that file to your Dropbox's "Public" folder. Usually, though, to get the public link to that file, you'd have to access the Dropbox web interface. This script will copy it to your clipboard with just a few keystrokes.
First, copy the code below and paste it into AppleScript editor. Change the first two lines to match the path to your own Dropbox folder and you Dropbox ID (which you can find by going to the Dropbox web interface and hovering over a file in your Public folder — the ID will be the seven digit number that comes after /u/ in the URL).
property ifolder : "/Users/whitsongordon/Dropbox/Public/" property dropboxID : 123456
on findAndReplace2(toFind, toReplace, theText) set astid to AppleScript's text item delimiters set AppleScript's text item delimiters to toFind set textItems to theText's text items set AppleScript's text item delimiters to toReplace tell textItems to set editedText to beginning & toReplace & rest set AppleScript's text item delimiters to astid return editedText end findAndReplace2 using terms from application "Quicksilver" on open theseitems if application "Dropbox" is not running then launch application "Dropbox" repeat with aitem in theseitems tell application "Finder" set r to POSIX path of (aitem as text) set completePath to r as text set docName to my findAndReplace2(ifolder, "", completePath) set theurl to "http://dl.getdropbox.com/u/" & dropboxID & "/" & docName set the clipboard to theurl end tell end repeat end open end using terms from
Then, save the script as publicLink in ~/Library/Application Support/Quicksilver/Actions. If the Actions folder doesn't exist, you can create it. You'll also want to open up Quicksilver and go to Quicksilver > Catalog in the menu bar, click on Custom and hit the plus sign in the bottom left corner. Go to File and Folder Scanner and navigate to your Dropbox's Public folder. Hit choose and let it scan the folder.
Now, whenever you want to give someone the link to one of your public Dropbox files, you just need to invoke Quicksilver, type in the name of the file, hit tab and type in publicLink. Quicksilver will copy the URL to your clipboard and you can paste it in an email, IM or wherever else it needs to go.
Installing publicLink Quicksilver + Dropbox Action [Malt Igloos' Blog]