Now that I’m using a Mac, the screenshot uploader I wrote isn’t all that helpful. Shame, I was really enjoying the quick and easy screenshot sharing. Fortunately, OSX has some built-in hotkeys for taking screenshots. What’s more, you can change where they save. What’s even more, you can add scripted actions to folders with Applescript. Mix in a little Dropbox, and BAM, I’m sharing screenshots with the greatest of ease!
The flow goes like this: Capture screenshot (selection, window, screen, whatever), it gets saved to my Dropbox Public folder, the link gets copied into my clipboard, and I get a Growl notification when it’s all ready to go. Here’s how.
on adding folder items to this_folder after receiving added_items try setthe item_count tothenumberof items inthe added_items ifthe item_count isequalto1then set theFile toitem1of added_items set theRawFilename to ("" & theFile)
set tid toAppleScript's text item delimiters setAppleScript's text item delimitersto":" set theFileName to (textitem6of theRawFilename) astext setAppleScript's text item delimitersto tid
set theWebSafeFileName to switchText from theFileName to"%20"instead of" "
set theURL to"http://dl.getdropbox.com/u/8469532/" & theWebSafeFileName setthe clipboardto theURL astext
tellapplication"GrowlHelperApp"
-- Make a list of all the notification types -- that this script will ever send: setthe allNotificationsList to ¬ {"Public URL"}
setthe enabledNotificationsList to allNotificationsList
-- Register our script with growl. -- You can optionally (as here) set a default icon -- for this script's notifications. register asapplication ¬ "CopyDropboxURL" all notifications allNotificationsList ¬ default notifications enabledNotificationsList ¬ icon ofapplication"Dropbox"
notify withname ¬ "Public URL" title ¬ "Dropbox Public Folder Updated" description ¬ (theURL & " copied to clipboard.") applicationname"CopyDropboxURL"
endtell endif endtry end adding folder items to
to switchText from t to r instead of s set d totext item delimiters settext item delimitersto s set t to t's text items settext item delimitersto r tell t toset t toitem1 & ({""} & rest) settext item delimitersto d t end switchText
That’s it! Snap a screenshot (or drop a file in your Public folder, it all works the same), wait for the Growl notification, and paste away!