• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Delete spot channels toggled off

Community Beginner ,
Jan 07, 2017 Jan 07, 2017

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.

TOPICS
Actions and scripting

Views

596

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Jan 07, 2017 Jan 07, 2017

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

...

Votes

Translate

Translate
Adobe
Participant ,
Jan 07, 2017 Jan 07, 2017

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 );

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 07, 2017 Jan 07, 2017

Copy link to clipboard

Copied

LATEST

Thanks, Javier. The script worked exactly as needed.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines