Last active
January 4, 2016 07:59
-
-
Save peteburtis/8592257 to your computer and use it in GitHub Desktop.
A simple AppleScript droplet that uploads files and/or folders dropped on it to App.net, and then creates a new outgoing Mail.app message pre-populated with App.net's public links to those files/folders.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- A simple AppleScript droplet that uploads files and/or folders | |
-- dropped on it to App.net, and then creates a new outgoing | |
-- Mail.app message pre-populated with App.net's public links | |
-- to those files/folders. | |
-- | |
-- REQUIRES FileBase 0.8. (Free beta at http://filebase.co) | |
-- | |
-- REQUIRES OS X 10.9, only for the 'display notification' | |
-- command which could easily be deleted if use on 10.8 | |
-- or earlier is desired. | |
-- | |
-- To properly use this as a droplet, paste into AppleScript Editor | |
-- and then export your script as an Application. | |
-- | |
on open droppedFiles | |
if number of droppedFiles is 1 then | |
set userInfo to "Uploading " & name of (info for first item of droppedFiles) & " to App.net…" | |
else | |
set userInfo to "Uploading " & number of droppedFiles & " files to App.net…" | |
end if | |
display notification userInfo -- This is the only line in this script that requires 10.9 | |
tell application "FileBase" | |
set newUploads to (upload droppedFiles public yes) | |
set links to return & return -- Initialize a string with two newlines in it | |
repeat with anUpload in newUploads | |
set links to (links & short URL of anUpload & return) | |
end repeat | |
end tell | |
tell application "Mail" | |
make outgoing message with properties {content:links, visible:true} | |
activate -- brings mail to the front | |
end tell | |
end open | |
on run | |
choose file with prompt "Pick a file to email via App.net file storage:" | |
open {result} | |
end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment