Created
January 31, 2017 18:02
-
-
Save grahams/9aa80b06db160bc027e2aee70a685974 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function run(input, parameters) { | |
var app = Application.currentApplication() | |
app.includeStandardAdditions = true; | |
for(var x = 0; x < input.length; x += 1) { | |
var filePath = input[x].toString() | |
if(filePath.length > 0) { | |
var escaped = escape(filePath); | |
if( (escaped.toLowerCase().indexOf("resilio") > -1) && | |
(escaped.toLowerCase().indexOf("public") > -1) ) { | |
var pubUrl = escaped.replace(/^.*Resilio%20Sync\/Public/, "http://grahams.wtf/public") | |
app.setTheClipboardTo(pubUrl) | |
delay(.25); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script more or less works for Shortcuts as well. You want receive files from Quick Actions -> Run JS for Automation with Shortcut Input -> Copy JavaScript Result to clipboard