Copy link to clipboard
Copied
Is it possible to have a script delete all spot channels if their state is toggled off? The script would leave the composite RGB and all spot channels that were currently toggled on when the script was run.
Hey j.krueger, this script should remove all spot channels toggled off.
...var doc = app.activeDocument;
var docChannels = doc.channels;
var desc = new ActionDescriptor();
var list = new ActionList();
for( var i = 0; i < docChannels.length; i++ ) {
if( docChannels.kind == 'ChannelType.SPOTCOLOR' && !docChannels.visible ) {
var ref = new ActionReference();
ref.putName( charIDToTypeID( "Chnl" ), docChannels.name );
list.putReference( ref );
}
}
desc.putList( charIDToTypeI
Copy link to clipboard
Copied
Hey j.krueger, this script should remove all spot channels toggled off.
var doc = app.activeDocument;
var docChannels = doc.channels;
var desc = new ActionDescriptor();
var list = new ActionList();
for( var i = 0; i < docChannels.length; i++ ) {
if( docChannels.kind == 'ChannelType.SPOTCOLOR' && !docChannels.visible ) {
var ref = new ActionReference();
ref.putName( charIDToTypeID( "Chnl" ), docChannels.name );
list.putReference( ref );
}
}
desc.putList( charIDToTypeID( "null" ), list );
executeAction( charIDToTypeID( "Dlt " ), desc, DialogModes.NO );
Copy link to clipboard
Copied
Thanks, Javier. The script worked exactly as needed.