Save Chrome Tabs in a Markdown File and Take Notes with Script Kit

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

We put a lot of work into browsing the internet every day, it would be a pity to lose it all by closing all of our tabs.

Script Kit can collect all of the tabs you currently have open in Chrome using its getTabs method and store them anywhere you want.

This particular script converts the tabs to markdown links and stores them in a text file on your file system, but you could convert and store them using any approach you can think of.

Install save-tabs

// Name: Save Tabs

import "@johnlindquist/kit"

let tabs = await getTabs()

let tabsMd = tabs
  .map(tab => `* [${tab.title || tab.url}](${tab.url})`)
  .join("\n")

let notes = await editor(tabsMd)

let filePath = home("tab-notes.md")
await ensureFile(filePath)
await appendFile(filePath, notes)

edit(filePath)
Christine Wilks
~ 3 years ago

I don't know what's going wrong but this script doesn't save my notes. It saves all my browser tabs but not the notes that I add. To double check, I copied and pasted the script above.

John Lindquistinstructor
~ 3 years ago

Hmm, curious. 🤔

After the line:

let notes = await editor(tabsMd)

// add this
dev(notes)

Do you see your notes appear in the dev tools?

Christine Wilks
~ 3 years ago

I added the line but the notes don't appear in dev tools either.

John Lindquistinstructor
~ 3 years ago

Maybe it wasn't clear in the video, but we use cmd+s when "saving" (and cmd+w when closing) from the await editor(). Maybe that's the issue?

Christine Wilks
~ 3 years ago

Thanks. I'm pretty sure I was using cmd+s yesterday. I tried again after shutting down and restarting my computer this morning and it worked fine the first time. But it didn't save the notes on subsequent tries, whether appending or in a fresh doc.