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

how to select all channels with shortchut?

Community Beginner ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

I want to use action. so, I want select all channels with the menu bar. so use in multiple files. I use the script for more than 100 files. all files have a different name in channels. i also attache sample of my channels.Screenshot 2022-07-29 114446.png

TOPICS
Windows

Views

326

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 2 Correct answers

Community Expert , Jul 28, 2022 Jul 28, 2022

Try this function:

 

 

selectAllChannels();

function selectAllChannels() {
    var totCha = activeDocument.channels.length;
    var actCha = new Array();
    for (var i = (totCha - 1); i >= 0; i--) {
        actCha.push(activeDocument.channels[i]);
    }
    activeDocument.activeChannels = actCha;
};

 

 

There may be a faster way with Action Manager code, however, I'm not the one to answer that!

 

P.S. Actions and scripts are different things. Once installed, the script can be recorded into an

...

Votes

Translate

Translate
Community Expert , Sep 11, 2022 Sep 11, 2022

@ART CORNER â€“ I was obviously assuming that you had 3 channels ready to convert directly into RGB, you never mentioned having 4 spot channels that you needed to convert into an approximate RGB visual equivalent.

 

Seems easy enough to record into an action or to script step by step via the ScriptingListener plugin as you already know what to do step by step...

 

#target photoshop
try {
    if (activeDocument.mode == DocumentMode.MULTICHANNEL && activeDocument.channels.length == 4) {
        acti
...

Votes

Translate

Translate
Adobe
Community Expert ,
Jul 28, 2022 Jul 28, 2022

Copy link to clipboard

Copied

Try this function:

 

 

selectAllChannels();

function selectAllChannels() {
    var totCha = activeDocument.channels.length;
    var actCha = new Array();
    for (var i = (totCha - 1); i >= 0; i--) {
        actCha.push(activeDocument.channels[i]);
    }
    activeDocument.activeChannels = actCha;
};

 

 

There may be a faster way with Action Manager code, however, I'm not the one to answer that!

 

P.S. Actions and scripts are different things. Once installed, the script can be recorded into an action. A custom keyboard shortcut can also be applied to the installed script.

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 ,
Sep 08, 2022 Sep 08, 2022

Copy link to clipboard

Copied

your code is working.

Thank you, sir.

 

I want to convert the multi-channel files into RGB.

 

please help me. 

 

i have one more help needed please help me.

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 Expert ,
Sep 08, 2022 Sep 08, 2022

Copy link to clipboard

Copied


@ART CORNER wrote:

your code is working.

Thank you, sir.

 

I want to convert the multi-channel files into RGB.

 

please help me. 

 

i have one more help needed please help me.


 

@ART CORNER 

 

Try this:

 

#target photoshop
try {
    if (activeDocument.mode == DocumentMode.MULTICHANNEL && activeDocument.channels.length == 3) {
        activeDocument.changeMode(ChangeMode.RGB);
    }
} catch (e) {}

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 ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

really sorry,

 

but not working

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 Expert ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

Is the file in multichannel mode? Does the file have less or more than 3 channels?

 

The code previously posted checks for the file being in MC mode and only having 3 channels. You could try changing the check for 3 channels for greater than or equal to 3.

 

activeDocument.channels.length >= 3

 

 

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 ,
Sep 11, 2022 Sep 11, 2022

Copy link to clipboard

Copied

Not working properly,

Screenshot 2022-09-11 134906.png

 result

Screenshot 2022-09-11 134924.png

 

i need like my video

 

can you make a script for it?

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 Expert ,
Sep 11, 2022 Sep 11, 2022

Copy link to clipboard

Copied

LATEST

@ART CORNER â€“ I was obviously assuming that you had 3 channels ready to convert directly into RGB, you never mentioned having 4 spot channels that you needed to convert into an approximate RGB visual equivalent.

 

Seems easy enough to record into an action or to script step by step via the ScriptingListener plugin as you already know what to do step by step...

 

#target photoshop
try {
    if (activeDocument.mode == DocumentMode.MULTICHANNEL && activeDocument.channels.length == 4) {
        activeDocument.channels.add();
        activeDocument.activeLayer.invert();
        moveChannel(1);
        activeDocument.changeMode(ChangeMode.GRAYSCALE);
        activeDocument.changeMode(ChangeMode.RGB);
        selectAllChannels();
        var idmergeSpotChannel = stringIDToTypeID("mergeSpotChannel");
        executeAction(idmergeSpotChannel, undefined, DialogModes.NO);
    }
} catch (e) {}

// Functions

function moveChannel(chaInd) {
    function s2t(s) {
        return app.stringIDToTypeID(s);
    }
    var descriptor = new ActionDescriptor();
    var reference = new ActionReference();
    var reference2 = new ActionReference();
    reference.putEnumerated(s2t("channel"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(s2t("null"), reference);
    reference2.putIndex(s2t("channel"), chaInd);
    descriptor.putReference(s2t("to"), reference2);
    executeAction(s2t("move"), descriptor, DialogModes.NO);
}

function selectAllChannels() {
    var totCha = activeDocument.channels.length;
    var actCha = [];
    for (var i = (totCha - 1); i >= 0; i--) {
        actCha.push(activeDocument.channels[i]);
    }
    activeDocument.activeChannels = actCha;
}

 

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