Copy link to clipboard
Copied
Can someone demonstrate with Javascript how I can run a block of code depending on what the active document bit depth is
If activeDocument.bitsPerChannel is 16 then (run this code)
if activeDocument.bitsPerChannel is 8 then (run this code)
if activeDocument.bitsPerChannel is not any of above (run this code)
Ian
Like this:
var doc = app.activeDocument;
var bpc = doc.bitsPerChannel;
if (bpc === BitsPerChannelType.EIGHT) {
// do something here
} else if (bpc === BitsPerChannelType.SIXTEEN) {
// do something here
} else if (bpc === BitsPerChannelType.THIRTYTWO) {
// do something here
}
Copy link to clipboard
Copied
Like this:
var doc = app.activeDocument;
var bpc = doc.bitsPerChannel;
if (bpc === BitsPerChannelType.EIGHT) {
// do something here
} else if (bpc === BitsPerChannelType.SIXTEEN) {
// do something here
} else if (bpc === BitsPerChannelType.THIRTYTWO) {
// do something here
}
Copy link to clipboard
Copied
Thank you