4 ms·
It's not trivial, but roughly: use AppleScript/osascript to get the URLs, but mostly pass them to a ~50 line Bash script which: - Brings in the date path com
by incanus77 7mo ago
It's not trivial, but roughly: use AppleScript/osascript to get the URLs, but mostly pass them to a ~50 line Bash script which:
- Brings in the date path components for the dumped-to folder
- Makes a hash of the URL for an Obsidian doc (each tab gets their own doc)
- Uses Chrome command line (--headless --disable-gpu --dump-dom) to save a snapshot of the page contents
- Uses it again with --screenshot to make a thumbnail
- Create an Obsidian doc from a template
- If it's a single tab dump, pass -o to the script, which opens it in Obsidian for review
Lastly, I use the relatively-new Bases feature in Obsidian to make a nice "cards" view of the docs with their thumbnails.
I'm hoping to clean it up at some point and maybe release it, but it's one of those classic one-shot systems that just works for me for now.
- zimpenfish 7mo ago> - Uses Chrome command line (--headless --disable-gpu --dump-dom) to save a snapshot of the page contents > - Uses it again with --screenshot to make a thumbnail You could combine both of those into "run Archivebox somewhere and pass the URLs into that" (which is what I do for "URLs I save to Instapaper" - they go to my Linkhut, Pinboard, my Archivebox, and once I've fixed my code, to archive.org as well.)
- incanus77 7mo agoNice, thanks for the vote on it. Been meaning to look into a personal archiving solution, and now the pendulum is swinging back in the direction of homelab for me so it's on the list.
- chongli 7mo agoHow does Hammerspoon help with this? Seems like just AppleScript and bash. Also if I may ask, how do you like Obsidian? I had never heard of it until now. Seems like a competitor to the Notes feature of iOS/macOS, but with its own subscription for syncing independently of iCloud?
- incanus77 7mo agoI mean, in this case, the Hammerspoon part is really just the hyper keybind and the easy run of AppleScript text inline. But... once you've got some stuff going, it's easier to hook into Hammerspoon as the "frontend" for other things as your systems grow. Obsidian is good! This use of Bases is really my only "proprietary" use of anything Obsidian-specific. The rest is a combo of personal reference, brainstorms, intricate client work specs or outlines, and the beginnings of a personal wiki. The keybinds are great, everything is in one big folder for now, and the fuzzy search makes it fast. For sync, I just have my vault in a folder that is part of my overall Syncthing, so all my computers can access it. On mobile (iPhone moving to Android, and iPad) it's just read-only for now; not using their sync or doing any writing into the system from mobile. Somewhat relatedly, I just got Standard Notes going on all systems (Mac/Linux/iPhone/Android/iPad) which is good for reliable capture at all places for me right now. I'm not paying, so I don't have (Markdown or other) formatting like in Apple Notes yet.
- joemi 7mo agoAh. Given the context, I had assumed it relied more on hammerspoon and less on applescript. I'm a bit less excited about it than I was, but I'll still look into doing similar sometime since I'm a habitual tab-opener.
- incanus77 7mo agoFWIW, if you prefer Lua, all of that could be accomplished with it instead of Bash. You'd probably still call out to Chrome for those bits.