Skip to content

Instantly share code, notes, and snippets.

@kickbase
Last active October 12, 2016 16:07
Show Gist options
  • Save kickbase/057a2c7fba88a043ddf26d05583605b4 to your computer and use it in GitHub Desktop.
Save kickbase/057a2c7fba88a043ddf26d05583605b4 to your computer and use it in GitHub Desktop.
[Mac] [Service] [JXA] Copy file or directory path
function run(input, parameters) {
var sys = Application("System Events");
var user_name = sys.currentUser().name();
return input.toString().replace("/Users/" + user_name, "~");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment