If you drag URLs around on a Mac, you get .webloc files. If you drag text around (successfully…), you get .textClipping files. Getting data back out of them can be annoying; some applications treat them as attachments, and most insist on grabbing the rich-text version of a clipping rather than the plain text.
webloc () {
/usr/libexec/PlistBuddy -c 'print URL' "$1"
}
clipping () {
DeRez -noResolve -only utf8 "$1" |
perl -e 'while (<>) {
chomp;
next unless s/^\s+\$"([0-9A-F ]+)".*$/$1/;
tr/ //d;
$x.= $_;
}
print pack("H*",$x),"\n"'
}