Saving the Yak browser-trail

Saving your browsertabs to Markdown

Sunday, April 26, 2020
Last Modified on Wednesday, May 13, 2020

Browsing the internet allways leads you from one site to the other, you’re not finished reading the first but you see this reference to another item and before you know it you are ‘shaving the Yak'. You go back to where you started but do not want to discard the trail of interesting articles you found so far…

So you want to save all these open tabs to review them later, buth how? Saving it in you browser-bookmarks quickly becomes a mess and manually saving them is not an option. Automating it is!

Next question is, where to save to and in what format? In te past I have tried many application to keep my notes, Day One, Bear, Apple Notes and recently Boostnote. I have written scripts for Day One 2 and Bear but I’m using Markdown more and more in my daily workflow.

Save Chrome, Safari or Iridium browsertabs to Markdown

There are three scripts; for Chrome for Safari and for Iridium(Updated: 2020-05-13).

AppleScript support for Firefox is stil an issue.

Chrome and Safari tabs to Markdown

The AppleScripts (written in JavaScript) save all tabs and URLs from the browser sorted by window to a new Markdown file.

The features

  • The markdown file is saved in you “Documents” folder
  • The name-format of the file: yyyy-mm-dd-[Chrome/Safari/Iridium]-tabs-[machine-name].md
  • The markdown file contains the tab names and URLs as clickable links.
  • URLs are grouped per browser window and seperated by a horizontal rule.
  • The date and the number of tabs and windows are displayed just below the title. In the title the name of the computer is used to identfy from which computer this file originated.

By default the markdown file is saved in your “Documents” folder. The location can be changed, the target directory is not checked so make sure it exists.

On succesfull creation of the markdown file a notification is displayed.

The Mardown result

The content of the Markdown-file ‘2020-04-26-safari-tabs-iMac.md’

# Safari tabs on iMac

26-04-2020, 7 tabs in 4 windows

- [yak shaving](https://en.wiktionary.org/wiki/yak_shaving)
- [bikeshedding](https://en.wiktionary.org/wiki/bikeshedding)
- [when you're up to your neck in alligators, it's hard to remember that your initial objective was to drain the swamp](https://en.wiktionary.org/wiki/when_you%27re_up_to_your_neck_in_alligators,_it%27s_hard_to_remember_that_your_initial_objective_was_to_drain_the_swamp)

---

- [Mac Automation Scripting Guide: Displaying Notifications](https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/DisplayNotifications.html#//apple_ref/doc/uid/TP40016239-CH61-SW1)

---

- [tIsGoud/save-safari-tabs-to-markdown](https://github.com/tIsGoud/save-safari-tabs-to-markdown)
- [tIsGoud/save-chrome-tabs-to-markdown](https://github.com/tIsGoud/save-chrome-tabs-to-markdown)

---

- [Saving the Yak browser-trail](http://tisgoud.nl/2020/04/saving-the-yak-browser-trail/)

---

Next steps

  • Download the zip file or clone the repository for Chrome and/or for Safari.
  • Run the script(s) from the Script Editor to test the script in your environment, don’t forget to set the language to JavaScript.

Once you made sure it works on your system you can:

On my MacBook I went for the last option 😉

Save browser-tabs to markdown

The links to the GitHub repositories for saving tabs to Markdown:

Older scripts for Bear and Day One 2

The links to the GitHub repositories for saving tabs to Bear or Day One 2: