Automatically save all your open Safari tabs to a markdown file before an exam, hackathon, or study session.
You've got 30+ Safari tabs open as references, but exam invigilators or hackathon rules require a clean machine. You need to close everything but can't lose your resources.
Run one command. All tabs saved to a markdown file. Safari cleared. Resume later.
Perfect for:
- Exam prep — Save your last-minute YouTube tutorials and notes, then close Safari completely
- Hackathons — Clean browser, but all your reference links saved for during the event
- Study sessions — Stop browser clutter mid-study without losing context
- Clone this repo:
git clone https://github.com/yourusername/SaveSafariTabs.git
cd SaveSafariTabs- Make the script executable:
chmod +x saveSafariTabs.sh
chmod +x saveFirefoxTabs.sh- (Optional) Add alias to your shell config for quick access:
echo "alias savetabs='~/path/to/saveSafariTabs.sh'" >> ~/.zshrc
source ~/.zshrcRun the script:
./saveSafariTabs.sh
./saveFirefoxTabs.shOr if you added the alias:
savetabsA markdown file (safari-tabs.md) appears on your Desktop with all open tabs as clickable links.
File: saveSafariTabs.sh
- Modern, reliable
- Works on macOS Monterey+
- Better error handling
- Output: Clean markdown format
File: SaveSafariTabs.scpt
- Older approach
- Still works, but less flexible
- Use this only if bash script has issues
# Safari Tabs - Thursday, 3 July 2026 at 15:45
Saved tabs to resume later
- [UNI_CLASS Course Materials](https://example.com)
- [Networking Tutorial - YouTube](https://youtube.com/...)
- [RFC 3986 - URI Spec](https://tools.ietf.org/...)- Requires macOS (uses AppleScript + Bash)
- Safari must have permission in System Settings → Privacy & Security → Automation (Automatically done if you are the admin)
- Creates/overwrites
safari-tabs.mdon your Desktop each time you run it (point it where you want the file put, obsidian vault/drive/dropbox etc.)
I built this for:
- Exams — Study right up until the invigilator says go, then save + close
- Hackathons — Keep your workspace clean without losing reference materials
- Study sessions — Stay organised without browser tab chaos