Save for Web API?

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

Victorious

Save for Web API?

Post by Victorious »

Hi guys, new user here, although I've been lurking for a while.

I'm wondering if anyone ever implemented a full Save for Web API? I couldn't find anything in xtools. Did I overlook it?

I made a modest start based on script listener output. I've attached it, even though it's not finished (only basic PNG-24 support) or intended for general use. Maybe someone has some use for it. I've commented most parts and decyphered most parameters. The work lies in the fact that diff. file formats introduce diff. parameters in the action descriptors etc.

Greets,

Victor

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

Mike Hale

Save for Web API?

Post by Mike Hale »

SaveForWeb is part of the DOM. See Document.exportDocument.

You can use action manager(scriptlistener) if you are unhappy with the results of the DOM method or want to support metadata which has been added to SFW but not yet to the ExportOptionsSaveForWeb. It seems that most people make a separate function for each format.

However I guess you could create your own custom options object and make a general function using that object to determine how to built the descriptor. But as you pointed out that would be a lot of work and I don't really see an advantage over using separate function or the DOM.
Victorious

Save for Web API?

Post by Victorious »

I overlooked the DOM method apparently, hehe. Well thanks for preventing me from wasting more time on a custom method...
Mike Hale

Save for Web API?

Post by Mike Hale »

I didn't mean to discourage you. If you are new to scripting it would be a great learning exercise.

I just think that the final code would be longer and slower than using separate AM functions or the DOM