-
1. Re: CS6 png save options
Muppet Mark Apr 11, 2012 12:54 PM (in response to dgolberg)Either put an if statement that checks the app version inside your function or test elsewhere and pass the value to your function… ( only got CS5 last year hum )
-
2. Re: CS6 png save options
dgolberg Apr 11, 2012 1:12 PM (in response to Muppet Mark)That's kind of what I figured, but what do I have to change to get it to save using the "Smallest / Slow" compression if CS6 is detected? I'm not sure what changes need to be made to get it to change the compression type, as I don't currently have CS6 to test it with (and I probably wouldn't know what to change anyway, unless it's simply a second boolean in the "saveAs" line). There are people running this script, though, that are using CS6, so I need to make sure it's programmed in.
-
3. Re: CS6 png save options
Paul Riggott Apr 11, 2012 1:40 PM (in response to dgolberg)Are you sure this is CS6 as I do not see these options, could it be someone is using a plugin?
-
4. Re: CS6 png save options
xbytor2 Apr 11, 2012 1:46 PM (in response to Paul Riggott)I see it in the the PSCS6 beta rev m.415 on Win7. No plugins in stalled. I don't have the scripting docs handy so I don't know if they added stuff in the DOM to support compression. He may have to end up using ActionManager code to get this to work.
-
5. Re: CS6 png save options
eddit Apr 11, 2012 1:59 PM (in response to dgolberg)dgolberg is correct, this is a new option for cs6. I'm in the same boat, trying to find out how I can automate this option in.
I tried a quick hack to achieve this by running "Save As" manually and save it as an action, then call the action from your script HOWEVER I found that it doesnt seem to apply any compression at all, regardless of the fact that the action says it's using compression. I'm thinking there's a bug in here somewhere.
-
6. Re: CS6 png save options
misoa Apr 19, 2012 6:23 AM (in response to dgolberg)Hi dgolberg
I had same problem and solved it.
pngSaveOptions = new PNGSaveOptions()
pngSaveOptions.compression=9 // (level of compression 0 .. 9 0 - without compression)
pngSaveOptions.interlaced=false
-
7. Re: CS6 png save options
dgolberg Apr 19, 2012 12:21 PM (in response to misoa)That did it! Thanks a ton misoa!
Edit: And it also still works in CS4 without having to setup a version check to run it differently!
-
8. Re: CS6 png save options
Navarro Parker Feb 18, 2013 12:31 PM (in response to misoa)I'm doing something wrong.
I'm not getting any PNG compression in CS6 with this:
}
function SavePNG(saveFile){
pngSaveOptions = new PNGSaveOptions()
pngSaveOptions.compression=9 // (level of compression 0 .. 9 0 - without compression)
pngSaveOptions.interlaced=false
activeDocument.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);
}
-
9. Re: CS6 png save options
Paul Riggott Feb 18, 2013 1:35 PM (in response to Navarro Parker)You could try this...
var saveFile = File(Folder.desktop + "/test.png"); savePNGCS6(saveFile); function savePNGCS6(saveFile) { var desc = new ActionDescriptor(); var desc2 = new ActionDescriptor(); desc2.putEnumerated( charIDToTypeID('PGIT'), charIDToTypeID('PGIT'), charIDToTypeID('PGIN') ); desc2.putEnumerated( charIDToTypeID('PNGf'), charIDToTypeID('PNGf'), charIDToTypeID('PGAd') ); desc2.putInteger( charIDToTypeID('Cmpr'), 9 ); desc.putObject( charIDToTypeID('As '), charIDToTypeID('PNGF'), desc2 ); desc.putPath( charIDToTypeID('In '), new File( saveFile ) ); desc.putInteger( charIDToTypeID('DocI'), 308 ); desc.putEnumerated( stringIDToTypeID('saveStage'), stringIDToTypeID('saveStageType'), stringIDToTypeID('saveSucceeded') ); executeAction( charIDToTypeID('save'), desc, DialogModes.NO ); };