do shell script " pbpaste | # 1st pass we fix line endings # (0777 should empty the clipboard to make room for our results) perl -0777pe 's/\\r\\12?/\\12/g' | # 2nd pass turn ftp links into http links # big assumption is your doc root is a folder called www or public - tweak as needed perl -pe 's#^s?f(tp://)[^@]+@(ftp|www)?\\.?([^/]+).*(www|public_html)(.*)#ht$1www.$3$5#' | # put it back on the clipboard pbcopy "
open ftp2url in the applescript editor