Hey everyone, I'm trying to update a portion of my .jsx code that worked in CS5, and now doesn't work in CS6.. EXR format is now included in CS6, and handles the alpha channel differently, basically it recognizes it now, as it didn't before as many of you know.
So I am using the script listener to try and create a simple variable to pass on at save time, and I'm having problems with it saving the .exr when I try to pass the variable for the file path through... for instance, if I run this code on a file with an alpha channel, (it has to be 32 bit or it will error out):
function saveEXR(archiveFile) {
var idsave = charIDToTypeID( "save" );
var desc14 = new ActionDescriptor();
var idAs = charIDToTypeID( "As " );
desc14.putString( idAs, """OpenEXR""" );
var idIn = charIDToTypeID( "In " );
desc14.putPath( idIn, new File( "L:\TF_testFile\TF_testFile_red_a_v01.exr" ) );
var idDocI = charIDToTypeID( "DocI" );
desc14.putInteger( idDocI, 84 );
var idCpy = charIDToTypeID( "Cpy " );
desc14.putBoolean( idCpy, true );
var idsaveStage = stringIDToTypeID( "saveStage" );
var idsaveStageType = stringIDToTypeID( "saveStageType" );
var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
desc14.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
executeAction( idsave, desc14, DialogModes.NO );
}
saveEXR()
Then it works just fine, the problem is passing a dynamic path/name through the save function. So if I swap a couple lines, for instance:
function saveEXR(archiveFile) {
var idsave = charIDToTypeID( "save" );
var desc14 = new ActionDescriptor();
var idAs = charIDToTypeID( "As " );
desc14.putString( idAs, """OpenEXR""" );
var idIn = charIDToTypeID( "In " );
desc14.putPath( idIn, archiveFile);
var idDocI = charIDToTypeID( "DocI" );
desc14.putInteger( idDocI, 84 );
var idCpy = charIDToTypeID( "Cpy " );
desc14.putBoolean( idCpy, true );
var idsaveStage = stringIDToTypeID( "saveStage" );
var idsaveStageType = stringIDToTypeID( "saveStageType" );
var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
desc14.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
executeAction( idsave, desc14, DialogModes.YES );
}
saveEXR(archiveFile)
Then it doesn't work. Also, it will error saying it was unable to write the file. I checked, and it IS in fact passing the file into the correct directory and naming it properly, but it's not including the alpha channel at all. Soooooooo if anyone has any sort of clue what may be happening here, or if this sounds like a bug... I'd appreciate it. I'm stuck. ![Sad :(]()