Skip to main content
September 14, 2019
Question

Save for Web javascript Output Settings

  • September 14, 2019
  • 4 replies
  • 563 views

Photshop api does not appear to have reference to Save for Web "Output Settings".  Is this something that might be accessed using ActionDescriptor?  Particulary would like to make sure from Saving Files that all File Compatibilty options are set to false.

This topic has been closed for replies.

4 replies

Stephen Marsh
Community Expert
Community Expert
September 14, 2019

Can you post a screenshot showing the desired file format (perhaps circle or highlight or otherwise annotate the exact options).

 

Edit: Here is a screenshot from the JS Reference, which options outside of these are you looking at?

 

September 15, 2019

I certainly can. See below. Yes, we set certain properties from the js reference provided. The issue is when using save for web (legacy) is spaces in the files name are replaced with dashes. Not a big deal but not the desired result. To resolve User must adjust Output Settings:Saving Files:FIlename Compatibility.  So we are looking to progromatically apply these settings.

 

 

 

Stephen Marsh
Community Expert
Community Expert
September 15, 2019

To change the hyphen to a word-space in the filename output, the AM code for ( "ovCU" ) ( idovCU, true );

 

 

 

 

 

var idovCU = charIDToTypeID( "ovCU" );
desc408.putBoolean( idovCU, true );

 

 

 

 

 

Should be changed from true to false:

 

 

 

 

 

var idovCU = charIDToTypeID( "ovCU" );
desc408.putBoolean( idovCU, false );

 

 

 

 

 

Here is a screenshot when I was comparing the difference in the recorded SL code, based on two different outputs with different SfW settings:

 

 

Of course, to make the recorded AM code usable, I had to run it through Clean SL, which totally changed the code structure, however the boolean is in the same relative position in the reworked code (3rd last boolean). 

 

You could likely change "ovCM"/idovCM and "ovCW"/idovCW to false as well.

 

I am guessing that:

ovCM = Mac

ovCW = Win

ovCU = unix

 

Hope this helps!