Skip to content

Instantly share code, notes, and snippets.

@yene
Created June 25, 2015 17:28
Show Gist options
  • Save yene/6c9b361b47584109bddf to your computer and use it in GitHub Desktop.
Save yene/6c9b361b47584109bddf to your computer and use it in GitHub Desktop.
Folder Action that copies Dropbox Public URL to clipboard
function run(input, parameters) {
dropboxURL = "https://dl.dropboxusercontent.com/u/XXXXXXX/FOLDER/";
currentApp = Application.currentApplication()
currentApp.includeStandardAdditions = true
inFile = input.toString()
inFile = basename(inFile)
inFile = encodeURIComponent(inFile)
//currentApp.displayAlert(dropboxURL + inFile);
currentApp.setTheClipboardTo(dropboxURL + inFile)
currentApp.displayNotification('Dropbox URL copied to clipboard.')
return input;
}
function basename(path) {
return path.split('/').reverse()[0];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment