Skip to main content
silk-m
Community Expert
Community Expert
Nov 24, 2019 10:21 AM UTC
Answered

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

こんにちは

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

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

 

これを

こうしたいです。

 

This topic is closed to new replies. Start a new post to keep the conversation going.
Kukurykus
KukurykusCorrect answer
Legend
Nov 24, 2019 11:19 AM UTC

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
Nov 24, 2019 11:19 AM UTC

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)
}
Translate
silk-m
Community Expert
silk-mCommunity ExpertAuthor
Community Expert
Nov 24, 2019 3:28 PM UTC

Hi, Kukurykus
Your script worked perfectly.
Thank you.

 

Best regards,

 

Translate
--Susumu Iwasaki
Kukurykus
Legend
Nov 24, 2019 3:30 PM UTC

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

Translate