Hi,
my primary browser is Firefox, thus I wrote an AppleScript which creates an “Almost Rich-Text” note from the current Firefox selection.
As of Firefox 3.5 (as far as I know), a copied selection from Firefox will be in HTML format, which will preserve all links, images and some rudimentary styling. This HTML record can be converted to RTF(D) to have an offline version of the entry with all images inside.
I hope you’ll find this script useful and if you have any problems just let me know.
(*
Create almost rich text note from Firefox' clipboard
Created by Patrick Mosby on Mar Wed 25 2009.
Copyright (c) 2009. All rights reserved.
How to use this script
Select a portion of a website and invoke the script
with any of the varios methods like FastScripts,
Quicksilver, Launchbar, QuicKeys…
All the links and rudimentary styling will be preserved.
I haven't specified a destination for the 'newRecord' as I'm
using the new destination selector which will pop up as
soon as you invoke the script.
Tested only with Firefox 3.1b3 - 3.5 and DEVONthink Pro 2
*)
property theTitle : "(REPLACE THIS TEXT)"
tell application "Firefox"
activate
tell application "System Events" to keystroke "c" using command down
try
set theWindow to window 1
set theTitle to the name of theWindow
on error
display dialog "Please provide a title:" default answer theTitle
set theTitle to text returned of result
end try
end tell
tell application "DEVONthink Pro"
set newRecord to paste clipboard
set theRichRecord to convert record newRecord in parent 1 of newRecord to rich
set name of theRichRecord to theTitle
delete record newRecord
tell application "GrowlHelperApp"
set the allNotificationsList to ¬
{"Success Notification", "Failure Notification"}
set the enabledNotificationsList to ¬
{"Success Notification"}
register as application ¬
"Add to DEVONthink" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "DEVONthink Pro"
notify with name ¬
"Success Notification" title ¬
"Import Success" description ¬
"Successfully imported" application name "Add to DEVONthink"
notify with name ¬
"Failure Notification" title ¬
"Import Failure" description ¬
"Alas — you won't see me until you enable me..." application name "Add to DEVONthink"
end tell
end tell
P.S.: Feedback on how to improve this script is desired.