Hi Bernard,
The following script should do the trick:
tell application "Safari" to activate
tell application "System Events"
tell process "Safari"
keystroke "s" usingcommand down-- Save As…
repeat until sheet 1 of window 1 exists
delay 0.1
end repeat
keystroke "d" usingcommand down-- save to Desktop
tell sheet 1 of window 1
clickpop up button 1 of group 1
keystroke "W" & return-- Web Archive
keystrokereturn-- Save
if sheet 1 exists then -- that is "sheet 1 of sheet 1"
click button "Replace" of sheet 1
end if
end tell
end tell
end tell