I have been using the following script to add the URL from the frontmost Firefox browser window to DT as a web archive, and also to provide notification via Growl that the web archive has been successfully completed:
--Define the Growl parameters
set growlMessage to " was saved to group--> "
set myNotice to "Simple notice"
set myGrowlApp to "Growl Applescripts"
set myTitle to "Save to Devonthink"
--Register this script with Growl using the DTP icon
tell application "GrowlHelperApp"
register as application myGrowlApp all notifications {myNotice} default notifications {myNotice} icon of application "DEVONthink Pro"
end tell
tell application "System Events"
if ((application processes whose (name is equal to "firefox-bin")) count) is greater than 0 then
if (count of windows of application "Firefox") is greater than 0 then
tell application "Firefox"
try
set theURL to «class curl» of window 1
set theTitle to «class pTit» of window 1
end try
tell application "DEVONthink Pro"
activate
with timeout of 120 seconds
try
set theDestination to display group selector "Destination" buttons {"Cancel", "OK"}
set theArchive to create record with {name:theTitle, type:html, URL:theURL} in theDestination
set data of theArchive to download web archive from theURL
end try
end timeout
end tell
activate
end tell
--Growl Notification of success
tell application "GrowlHelperApp"
set theGroup to (name of theDestination as string)
notify with name myNotice title myTitle description theTitle & growlMessage & theGroup application name myGrowlApp
end tell
else
tell application "GrowlHelperApp"
notify with name myNotice title myTitle description "Clipping failed. Firefox is not running!" application name myGrowlApp
end tell
end if
else
tell application "GrowlHelperApp"
notify with name myNotice title myTitle description "Clipping failed. Firefox is not running!" application name myGrowlApp
end tell
end if
end tell
I was hoping someone could help me modify this script so that I could pre-define a specific Destination/Group which web archives should always be captured to, and then have things setup so that the web archive would be added to DT in the backgroud, thereby allowing me to continue browsing in Firefox without having to switch back to it from DT…
Any suggestions would be greatly appreciated… Thanks!