tell application \"Safari\"
set t to name of window 1
set s to URL of document 1
end tell
tell application \"MarsEdit\"
set u to selected text of document 1
set selected text of document 1 to \"<a href=\\"\" & s & \"\\" title=\\"\" & t & \"\\">\" & u & \"</a>\"
end tell
It looks like you're new here. If you want to get involved, click one of these buttons!