Its save as webarchive format, in a chest, in a folder named after the site, named site dash time. It also add the URL to spotlights comments so you know where it come from, getting the URL in the Metadata is tricky. Webarchive’s add keywords automatically to the metadata. I think its a good way to save you web pages, I got it on a control a keystroke in Safari with FastScripts
property TheURL : "http://www.macscripter.net/"
property SuffixOptions : {".com", ".net", ".org", ".info", ".us", ".biz", ".tv", ".mobi", ".cc", ".ws", ".bz", ".tc", ".vg", ".ms", ".gs", ".name", ".co.uk", ".de", ".be", ".eu", ".at", ".com.mx", "org.uk", ".me.uk", ".co.nz", ".net.nz", ".org.nz", ".cn", ".tw"}
tell application "Safari"
activate
if document 1 exists then
set TheURL to URL of document 1
else
make new document
delay 5
set TheURL to URL of document 1
end if
end tell
set tempPath to path to desktop as string
set tempName to "a.webarchive"
set tempFile to tempPath & tempName
set TheHost to FindDomainName(TheURL)
set TimeStamp to do shell script "date -n +%Y-%m-%d-%H-%M-%S"
set thepath to ((path to desktop) as string) & "chest:saved:" & TheHost & ":"
set TheName to TheHost & "-" & TimeStamp & ".webarchive"
do shell script "mkdir -p " & (POSIX path of thepath)
set theFile to thepath & TheName
tell application "Safari"
activate
if document 1 exists then
tell application "System Events"
tell process "Safari"
keystroke "s" using command down
keystroke "a" using command down
keystroke tempName
delay 1
keystroke "d" using command down
click (pop up button 1 of group 1 of sheet 1 of window 1)
delay 1
click (menu item 2 of menu 1 of pop up button 1 of group 1 of sheet 1 of window 1)
delay 1
click (button "Save" of sheet 1 of window 1)
delay 2
end tell
end tell
end if
end tell
do shell script "mv " & (POSIX path of tempFile) & " " & (POSIX path of theFile)
tell application "Finder"
set comment of file theFile to TheURL
end tell
on FindDomainName(TheURL)
set TheSuffix to ""
repeat with CurrentSuffix in SuffixOptions
if TheURL contains (CurrentSuffix & "/") then
set TheSuffix to CurrentSuffix
exit repeat
end if
end repeat
if TheSuffix = "" then
return "Misc"
else
set SuffixOffset to offset of (CurrentSuffix & "/") in TheURL
set JustDomain to (characters 1 thru (SuffixOffset - 1) of TheURL) as string
set PointOffSet to 0
repeat with NegOffSet from (length of JustDomain) to 1 by -1
if character NegOffSet of JustDomain is "." or character NegOffSet of JustDomain is "/" then
set PointOffSet to NegOffSet
exit repeat
end if
end repeat
try
set JustDomain to (characters (PointOffSet + 1) thru (length of JustDomain) of JustDomain as string) & CurrentSuffix
on error
set JustDomain to "Misc"
end try
return JustDomain
end if
end FindDomainName
In Safari 3 Beta you still can’t save as webarchive by a non GUI method. But it can save as HTML where Safari 2 does .downloads files
I use this a lot so I hope people enjoy this.