Adobe Photoshop CS3
JavaScript Scripting Reference
JavaScript Object Reference 78
visibleChannelCount = 3
break;
case DocumentMode.CMYK:
visibleChannelCount = 4
break;
case DocumentMode.DUOTONE:
visibleChannelCount = 4
break;
case DocumentMode.MULTICHANNEL:
default:
visibleChannelCount = inDocument.channels. 1
break;
}
// now get the channels to activate into a local array
var aChannelArray = new Array()
// index for the active channels array
var aChannelIndex = 0
for(var channelIndex = 0; channelIndex < inDocument.channels.length;
chann+) {
if (channelIndex < visibleChannelCount) {
aChannelArray[aChann+] = inDocument.channels[channelIndex]
}
}
// now activate them
inDocument.activeChannels = aChannelArray
}