I have this big PSD file (300MB) which I need to somehow, export each layer as a web format (PNG for example) to fit them in a HTML. The only thing I found in PS is in the Scripts menu, the Export Layers to File option, but it takes forever and it doesn’t even save all layers. I also like them to be exported in a directory hierarchy, like they’re in PS, but this is optional.
I don’t know if i’m right but i assume you’re trying to create a layout for a website. If so you should consider using slice tool which is specifically useful when designing website template. To do so, once your template is done, select the slice tool and start to set every part of your design you want to slice. This work will also be useful to consider how you are going to structure your HTML code. Once your slices are all done, simply go to file>save for the web. Then choose png if you have some transparent image or jpg. You can optimize the weight of your picture in the save for the web window. you’ll notice on top 4 tabs that will enable you to compare the original image with the slice you’re about to save. Run some test to make your picture lighter but also check the point where you start to loose quality. By doing this you’ll end up with a good balanced image between weight and quality.
I hope i’m not off topic if not this is the right way to design web template in PS. So design your template, slice it image by image using slice tool and save for the web.