Save & Restore Safari Sessions
Update 06/12/23: ForgetMeNot is a plugin that saves and restores your tabs when you quit and restart safari. Works well for me.
Update 05/07/02: This script will no longer work in safari v2.0 and possibly also not in safari v1.3. There’s still some activity at this mac os x hints article, you might want to try some of the scripts posted in the comments there. If you’re really interested in saving and restoring safari sessions i’d recommend saft, a for-pay safari extension that’ll add full session support (among many other nifty features) to safari.
A while back, john gruber posted some applescripts to save and restore safari sessions. Back when i was on windows and used firefox i used session saver as mentioned before, which pretty much offers the same functionality and a little more (it also remembers your opened tabs when you quit firefox and restores them when the browser’s restarted). I was really looking forward to these scripts, until i realized that it doesn’t fit my needs.
The problem is that these scripts don’t work with tabs. If you’ve more than one tab open and use “save safari urls” it’ll only save the currently selected tab. With googles goodwill i found this hint which is based on john grubers scripts. Just the thing i needed, except that it doesn’t remember pages in windows where no other tabs are open. So with some copy & paste and little original work i created the following save session script which serves my purposes quite well. Here’s the download link: Safari Session Saver.
As for restore session, i use the script by john gruber which works just fine for me.
Save session will save all tabs in all open windows in a text file. Restore session will reload all urls stored in that text file in its own tab, however in one single window.
As for known issues, there’re two i’m aware of: save session can only handle the tabs you can actually see, not those hidden behind the “»”-button. No big problem for me, but you might want to investigate the aforementioned macosxhints post for a possible solution. The other one is that the script won’t work correctly if safaris download manager is open - quite bad, but i have no idea how to fix that.