Skip to main content
Participating Frequently
September 29, 2020
Question

Save for web scripting

  • September 29, 2020
  • 3 replies
  • 972 views

Does anyone have a readily available script for saving for web as optimised jpegs? i cant find one anywhere online, still learning javascript so would like to see how its done and then play around with it myself for a better understanding.

I've also looked in the photoshop documentation and cant find anywhere to script 'optimize to file size'? ideally i would like the quality to differ as i would want the max file size to be 600kb for example. is this possible? its possible if i manually saveforweb?

3 replies

Stephen Marsh
Community Expert
Community Expert
September 29, 2020

Perhaps something like this?

 

EDIT: Link removed as it is now invalid

 
mindfulretouch.com/the-course/saving/saving-quality
 
Participating Frequently
September 29, 2020

unbelievable man! thank you haha, ill give this a go and see if it works the way i need it to. no idea how you found that!

c.pfaffenbichler
Community Expert
Community Expert
September 29, 2020

»to script 'optimize to file size'?«

What exactly do you mean? 

 

»I've also looked in the photoshop documentation«

Did you find this page? 

Participating Frequently
September 29, 2020

hi!
yes thats the page i was after, so in the saveforweb dialog box, you can save the image at a specified file size, this obviously determines the quality (0,100). The scripts intention is to save maybe 150-200 images per day and they cant really be above 700kb each as theyre used for ecom purposes.

c.pfaffenbichler
Community Expert
Community Expert
September 29, 2020

That’s not in the DOM, as dar as I can tell. 

Does it produce identifyable AM code with ScripitingListerner.plugin? 

Otherwiese the Script would probably need to itterate through quality settings, check the size until it hits an acceptable one. 

Participating Frequently
September 29, 2020

https://community.adobe.com/t5/photoshop/photoshop-script-for-faster-save-for-web/td-p/10735828?page=1

update, just found this and i think this is what im after in regards to the file saving, no luck finding any info on the file size optimisation though!