I'm fairly new to Photoshop (Still CS4) and I often get designs for websites where slicing them up takes a fairly decent amount of time. Some sites have layers that are all going to be the same exact size, and they are stacked on top of each other (Slideshows, that type of thing).
I usually move these layers to a new document with the size I need, display one at a time, and "Save for web" as 24-bit transparent (non-interlaced) PNGs. Sometimes its only 5 images, other times its 10 times that. I don't mind getting paid to do this, but after a while it gets incredibly boring and I would like to automate it.
I have some basic JS experience with Adobe specific APIs from Illustrator, but no experience with Photoshop.
I don't have PS on my machine here, but does the script under File -> Scripts -> Layer Comps to Files help? You can create different layer comps and then files from them. I don't know about output formats though.
Edit: You can also make a copy of the Layer Comps to Files script and change it to call Save for Web. See the reference book.