Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.6: Create a Service to copy a file path URL to the clipboard' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Create a Service to copy a file path URL to the clipboard
Authored by: robleach on Aug 20, '14 09:32:43AM
I just edited my "Copy Public URL" service because I noticed that I wasn't getting my domain name. Here's the new shell script for automator (note: I use tcsh):

set FULLHOST=`host $HOST | perl -pne 's/ has address .*//;$_=lc'`
sed -e 's/:/\//g' -e 's/\ /%20/g' -e "s/^\/Users\/$USER\/Sites/http:\/\/$FULLHOST\/~$USER/g" | pbcopy


The result looks something like this:

http://mycomputer.mydomain.com/~myname/mypath/myfile.ext

Rob
Edited on Aug 20, '14 09:33:39AM by robleach


[ Reply to This | # ]