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.
// 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)
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.
Hmm, curious. 🤔
After the line:
let notes = await editor(tabsMd)
// add this
dev(notes)
Do you see your notes appear in the dev tools?
I added the line but the notes don't appear in dev tools either.
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?
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.