I'm looking to do the same thing... can anyone help?
Your script does not seem to work. I get this error box when I try to run it in CS3.
Error 19: Bad argument appDialogBackground.
-> var brush = digMain.graphics.newBrush
That line should not be a problem, I wonder if you are trying to run the script from ExtendScript Toolkit?
If so you need to set the target as Photoshop (Top Left dropdownlist)
If not, that line is not really required and can be commented out.
An alternative to this script is my Layer Saver Script that might be of use...
I am running the script from within Photoshop CS3. I am on Mac OS Leopard. It looks like that Layer Saver is only for Windows?
Edit: Ah, nevermind, saw that yours is for Mac as well at the top of the page. This seems to work good. Thanks!