Working with Safari and Evernote on different customers without pain

Sometimes I have to change my customers… It’s part of my work in IT as a freelance.

Normally I go to one and follow a project, go to another and follow a different kind of works, etc.

With Evernote I can manage a Notebook Stack called “Work” and, in it, I put a different notebook for every customer, with specific notes, link, ideas…

I have also a notebook called “Stuff” with generic notes useful for every customers.

But, from every customers, I’ve to use Safari to search informations… at the end of work on every customer I’ve a lot of opened tabs, and sometimes I need to save that for the next usage.

Unfortunately, Safari don’t have a function for that… of course, there is theer history, but keep also the closed tabs, so can bit a little frustrated searching on that….

But, I use a Mac, and AppleScript can help me to do that.

I’ve wrote a little AppleScript to get the list of urls of the current opened tabs and put that list in the clipboard:

set _urls to {}
tell application "Safari"
  repeat with _tab in tabs of window 1
    set end of _urls to URL of _tab
  end repeat
end tell
set {_tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set the clipboard to _urls as string
set AppleScript's text item delimiters to _tid

I’ve saved as Application named “Safari Tabs to Clipboard” and put in the applications folder.

After, I need a way to restore the tabs… Some other AppleScript magic:

set _urls to paragraphs of (the clipboard as text)
tell application "Safari"
  activate
  repeat with _url in _urls
    do shell script "open -a "Safari" "" & _url & """
  end repeat
end tell

I named this “Clipboard to Safari Tabs” and save in the applications folder.

So, now my actions when I’ve done with a customer is this: - Launch the “Safari Tabs to Clipboard” application - Create a new note named “Tabs” in Evernote and put in the customer Notebook - Paste here the clipboard content and sync.

When I come back to that customer, for example after some weeks, I can: - Open customer Notebook in Evernote and get the last “Tabs” note - Copy the note content - Launch the “Clipboard to Safari Tabs” application

And voilà, now I’ve the same Safari situation!!!!

Enjoy

Written on March 28, 2013 - #Mac #Evernote