Skip to main content
silk-m
Community Expert
Community Expert
November 24, 2019
Answered

マルチチャンネルモードでチャンネル全てを選択するスクリプト

  • November 24, 2019
  • 4 replies
  • 548 views

こんにちは

スクリプトは初心者です。マルチチャンネルモードでチャンネル全てを選択するスクリプトがありますか?

チャンネル名は決まったものではありません。最大20チャンネル位になる場合もあります。

 

これを

こうしたいです。

 

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Kukurykus

It works when like in your example there are no default Color Mode Channels (so like for ex. RGB):

 

sTT = stringIDToTypeID; for(i = 0; i < (cnl = activeDocument.channels).length;) {
	(ref = new ActionReference()).putName(sTT('channel'), cnl[i++].name);
	(dsc = new ActionDescriptor()).putReference(sTT('null'), ref)
	dsc.putBoolean(sTT('extend'), true), executeAction(sTT('select'), dsc)
}

4 replies

Kukurykus
KukurykusCorrect answer
Legend
November 24, 2019

It works when like in your example there are no default Color Mode Channels (so like for ex. RGB):

 

sTT = stringIDToTypeID; for(i = 0; i < (cnl = activeDocument.channels).length;) {
	(ref = new ActionReference()).putName(sTT('channel'), cnl[i++].name);
	(dsc = new ActionDescriptor()).putReference(sTT('null'), ref)
	dsc.putBoolean(sTT('extend'), true), executeAction(sTT('select'), dsc)
}
silk-m
Community Expert
silk-mCommunity ExpertAuthor
Community Expert
November 24, 2019

Hi, Kukurykus
Your script worked perfectly.
Thank you.

 

Best regards,

 

--Susumu Iwasaki
Kukurykus
Legend
November 24, 2019

I saw you liked me as i_was5, but then changed to current account and reliked me 😉