Export All Safari Tabs to Evernote

Shared By: Justin

Description

Originally published elsewhere on this site, this script creates a note with a list of the URLs of each open tab in the frontmost window of Safari.Efficiency was foremost in my mind when creating this script. As such, the script creates the note in the default notebook and without any tagging. If anyone thinks that notebook selection and tagging should be included, please let me know in the comments below and I’ll consider adding it in!

The Code

(*
http://veritrope.com
Safari URLs List to Evernote Exporter
Version 1.0
October 28, 2009
Project Status, Latest Updates, and Comments Collected at:
http://veritrope.com/code/export-all-safari-tabs-to-evernote

Installation: Just double-click on the script!

FastScripts Installation (Optional, but recommended):
--Download and Install FastScripts from http://www.red-sweater.com/fastscripts/index.html
--Copy script or an Alias to ~/Library/Scripts/Applications/Yojimbo
--Set up your keyboard shortcut

CHANGELOG:

1.00    INITIAL RELEASE
*)

set url_list to {}
set the date_stamp to ((the current date) as string)
set NoteTitle to "URL List from Safari Tabs on " & the date_stamp
tell application "Safari"
    activate
    set safariWindow to window 1
    repeat with w in safariWindow
        try
            repeat with t in (tabs of w)
                set TabTitle to (name of t)
                set TabURL to (URL of t)
                set TabInfo to ("" & TabTitle & return & TabURL & return & return)
                copy TabInfo to the end of url_list
            end repeat
        end try
    end repeat
end tell

-- convert url_list to text
set old_delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to return
set url_list to url_list as text
set AppleScript's text item delimiters to old_delim

tell application "Evernote"
    set EVNote to (create note with text url_list title NoteTitle)
end tell

One Response to “Export All Safari Tabs to Evernote”

  1. steve says:

    Nice! I was going to write this but you saved me an hour!

rss Subscribe to Comments RSS Feed


You can use these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>