#!/bin/bash # Copy Text osascript </" | sed "s/|$/<\/td><\/tr>/" | # dealing with sed's dificulty in working with \n sed "s/$/$EL/" | sed "s/^/$SL/" | tr -d "\n" | # by replacing every \n with a marker, opening tables sed "s/$SL$EL$SL//"g | # # aligning tables -- normal aligment does not work, using div -- sed "s/$SL\[\[$EL$SL/$SL$EL$SL
/"g | sed "s/$SL\[\]$EL$SL/$SL$EL$SL
/"g | sed "s/$SL\]\]$EL$SL/$SL$EL$SL
/"g | sed "s/<\/tr>$EL$SL$EL/<\/tr><\/table>
$NewLine/"g | # closing tables sed "s/$EL/
$NewLine/g; s/$SL//g; s/>$NewLine/ s/<\/table>/<\/table><\/div>/g" | # closing divs sed "/
/ s/|/<\/td>$NewLine
/g" | # # aligning the cels sed "// s/
\(.*\) <\/td>/\1<\/td>/g" | sed "// s/
\(.*\) <\/td>/\1<\/td>/g"` ### Converting body=`echo "$body" | iconv -f MAC -t ISO-8859-1` #echo "$body" echo -e "\n$body\n" > /tmp/ClipBoard.html cd /tmp textutil -convert rtf ClipBoard.html cat ClipBoard.rtf | pbcopy osascript <