tell application "Safari"
activate
set theURL to URL of front document
set selectedText to (do _javascript_ "(''+getSelection())" in document 1)
set theTitle to do _javascript_ "document.title" in document 1
set winTitle to findReplace(theTitle, ":", "-")
set theDate to do shell script "date +'%Y-%m-%d'"
set the clipboard to winTitle & return & return & theURL & return & return & selectedText & return & return & theDate as string
end tell
on findReplace(theTxt, searchFor, replaceWith)
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to searchFor
set txtLst to every text item of theTxt as list
set AppleScript's text item delimiters to replaceWith
set theTxt to txtLst as string
set AppleScript's text item delimiters to oldDelims
return theTxt
end findReplace
-->error "Safari got an error: Can’t continue findReplace." number -1708