Skip to content

Instantly share code, notes, and snippets.

@statonjr
Created December 2, 2010 04:59
Show Gist options
  • Save statonjr/724798 to your computer and use it in GitHub Desktop.
Save statonjr/724798 to your computer and use it in GitHub Desktop.
Nu script to copy the path of the selected item in the Finder to the Clipboard.
#!/usr/local/bin/nush
(load "ScriptingBridge") ;; Access the Finder
(function path ()
(((((SBApplication applicationWithBundleIdentifier:"com.apple.Finder") selection) get) objectAtIndex:0) URL))
(function stripURL (path)
(path substringFromIndex:16))
(system ("echo " stringByAppendingString:((stripURL (path)) stringByAppendingString:" | pbcopy")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment