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
AppleScript support for Firefox is stil an issue.
- 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/) ---
- Download the zip file or clone the repository for Chrome and/or for Safari.
Once you made sure it works on your system you can:
- Turn it into a Automator workflow to create a Service.
- More information: Use Automator to create a System-Wide service or
- Use BetterTouchTool to set up a keybinding or
- Use BetterTouchTool to create a Touch Bar button.
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:
- Save Google Chrome tabs to a markdown file
- Save Safari tabs to a markdown file
- Save Iridium tabs to markdown file
Older scripts for Bear and Day One 2
The links to the GitHub repositories for saving tabs to Bear or Day One 2:
- Save Google Chrome tabs in a Bear note.
- Save Safari tabs in a Bear note.
- Save Chrome tabs in a Day One 2 entry.
- Save Safari tabs in a Day One 2 entry.