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!

Alfred Users — You Can Now Download an Extension of This Script Here

The Code

(*
http://veritrope.com
Safari URLs List to Evernote Exporter
Version 1.0
October 28, 2009

// SCRIPT INFORMATION AND UPDATE PAGE:
http://veritrope.com/code/export-all-safari-tabs-to-evernote

// TERMS OF USE:
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

// LIKE THIS SCRIPT?
If this AppleScript is helpful to you, please show your support here:
http://veritrope.com/support

// 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

2 Responses to “Export All Safari Tabs to Evernote”

  1. steve says:

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

  2. Laura says:

    Thanks for this script! Exactly what I was looking for, and it ran so quickly and easily! It’s now saved as an app for future use.

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>