Skip to content

Instantly share code, notes, and snippets.

@poritsky
Created March 14, 2013 16:24
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save poritsky/5162788 to your computer and use it in GitHub Desktop.
Save poritsky/5162788 to your computer and use it in GitHub Desktop.
For use with TextExpander. Get contents of selected file, copy and paste. I have it set with ",,pbpaste" in TextExpander.
tell application "Finder"
set sel to the selection as text
set fPath to quoted form of POSIX path of sel
do shell script ("cat " & fPath & " | pbcopy && pbpaste")
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment