Is there a way to grab a web archive from a page already loaded in Safari in one single step? Perhaps a script?
Yes. In the scripts menu (the little s) there is an “Add WebArchive to DEVONthink” item which does exactly what was expected
In fact thanks for asking… I hadn’t used it before… HANDY!
Yes, noticed it last night – did it just come with v1.1?
Could some scripter out there tell me how to revise the script to go into my default new items folder?
Here is a modification of the orginal scriot. Just replace “Safari Downloads” with the group name you want them in.
-- Add web archive from Safari to DEVONthink
-- Created by Christian Grunenberg on Wed Mar 15 2006.
-- Copyright (c) 2006. All rights reserved.
tell application "Safari"
try
if not (exists document 1) then error "No document is open."
set this_url to the URL of document 1
set this_title to the name of window 1
tell application "DEVONthink Pro"
set theGroup to create location "Safari Downloads" --replace the quoted text with the name of the group you want the documents placed in
set theArchive to create record with {name:this_title, type:html, URL:this_url} in theGroup
set data of theArchive to download web archive from this_url
end tell
on error error_message number error_number
if the error_number is not -128 then
try
display alert "Safari" message error_message as warning
on error number error_number
if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
end try
end if
end try
end tell
Thanks, works great!
Here’s a version that lets you select the group from a list. Thanks to DT for including this little gem in their applescript library.
tell application "Safari"
try
if not (exists document 1) then error "No document is open."
set this_url to the URL of document 1
set this_title to the name of window 1
tell application "DEVONthink Pro"
activate
set theGroup to (display group selector) --calls the nice built in group selection window
--set theGroup to create location "Safari Downloads" --replace the quoted text with the name of the group you want the documents placed in
set theArchive to create record with {name:this_title, type:html, URL:this_url} in theGroup
set data of theArchive to download web archive from this_url
end tell
activate
on error error_message number error_number
if the error_number is not -128 then
try
display alert "Safari" message error_message as warning
on error number error_number
if error_number is -1708 then display dialog error_message buttons {"OK"} default button 1
end try
end if
end try
end tell