A set of AppleScripts to create a scrapbook in Safari
Dec 04, '03 10:16:00AM
Contributed by: paulrob
As mentioned in a recent hint, it would be nice in Safari to have a scrapbook function like in Microsoft IE. I have created just such a feature, and you can download the scripts that I use in 10.2.8 for yourself.
WARNING: The scripts are for 10.2.8. I'm not on Panther - yet (hear that, Santa?). For 10.2.8, you must download GUI scripting addition from Apple. I understand that Panther has GUI scripting built-in but I'm not sure about the syntax, so maybe a scripter could edit the script and repost for 10.3 (if needed)?
[robg adds: Read the rest of the hint for the instructions; I haven't tested this one, but it seems like it would be quite handy.]
INSTRUCTIONS BEFORE USE:
- Make a new folder in your Safari config folder called Scrapbook (i.e in /Users -> UserName -> Library -> Safari -> Scrapbook).
- Save the two scripts to your script directory. (i.e /Users -> UserName -> Library -> Scripts). This way you can access them with the dropdown menu. Must be saved as applications without startup page.
- In Safari, make a new bookmark folder called "SCRAPBOOK" and another called "Seed for SCRAPBOOK" - must be exactly as shown - caps and all.
- Use your scheduler (cron, anacron, etc) to run the "Delete from Scrapbook" script at some appropriate interval. I use weekly at 1:00 am. You'll have to judge your usage rate.
- Go to your home page (or any page - doesn't matter). Press home and then save a new bookmark for that page to bookmark folder "Seed for SCRAPBOOK." The page you use for the new bookmark doesn't matter because all you're trying to do is force Safari to create a new bookmark that you must now edit. Flip to the bookmark window and navigate to the bookmark you just created. Edit the bookmark to read "BLANK PAGE" and the URL to "http://blank%20page/". Again exactly as shown.
TO USE:
When you want to save a page, simply click on "Add to Scrapbook" script. The page is saved as HTML and a bookmark pointing to the file is created in bookmark folder "SCRAPBOOK." The file can be retrieved and viewed in Safari by clicking on the bookmark in the usual way. Additional folders can be created with the bookmark folder "SCRAPBOOK" and the bookmarks moved into them without loss of function. In fact the bookmark can be moved to any part of the bookmark library without any problem.
To delete a file, simply delete the bookmark in Safari. That's all you need to do. When the "Delete from Scrapbook" script next runs, it compares the file list for the Scrapbook folder with the bookmarks, and deletes any file that does not have a bookmark pointing to it. Thus deleting the bookmark ensures that the file is eventually deleted. The whole bookmark database is searched, so even if the bookmark is moved, the script should still find it (if it exists.)
WARNING: Do not put any other files in your scrapbook folder for any other reason -- or you will lose them!
Finally I've added notes to the scripts to indicate what everything does.
Comments (28)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20031127154310258