Hi X,
I think a more reliable approach to try would be get the bit depth discovered while Bridge looks at the actual image data during thumbnail and preview generation.
You can access this data from the Bridge cache through Thumbnail.core.quickMetadata.bitDepth -- but you will want to do it after a preview has been generated.
Try saving the following example script in a folder of PSD files and running it from ESTK:
#target bridge
function testBitDepth( testFile )
{
var testThumb = new Thumbnail( testFile );
var bitDepthBefore = testThumb.core.itemContent.bitDepth;
//force preview generation, if it hasn't happened yet
app.synchronousMode = true;
testThumb.core.preview.preview;
app.synchronousMode = true;
// retreive bit depth from the cache
var bitDepth = testThumb.core.quickMetadata.bitDepth;
$.writeln("Bit Depth for: " + testThumb.name + " is " + bitDepth + " (before: " + bitDepthBefore + ")" );
}
var curFolder = new File( $.fileName).parent;
var psdFiles = curFolder.getFiles("*.psd");
for( var f = 0; f < psdFiles.length; ++f )
{
var testFile = psdFiles;
try{
testBitDepth( testFile );
}catch( e ) {
$.writeln("Doh! Error testing " + testFile.name + " " + e );
}
}
This method should work for any file for which you can also see a bit depth reported in the "File Properties" section of the Bridge metadata panel.
Cheers,
David