Skip to main content
Inspiring
January 9, 2017
Question

How to Select CTRL + Click command

  • January 9, 2017
  • 1 reply
  • 771 views

Hey

Frustrating but I cant find it...

I know there is selection.selectAll but I want to select only pixels in channel so... :

doc.ActiveChannel.select.select < ??

or

doc.channel[5].select.select ??

basically select pixels and then fill layer using selection

Regards

Dariusz

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
January 9, 2017

You can load a channel as a selection usinak acyion manager code.  I would also think you coul also add to the selecton by adding accitional channels to the selection.  The Acyion managet load may look something like this:

// ======Load Alpha Channel Selection===============================

function loadAlpha(channel) {

  var idsetd = charIDToTypeID( "setd" );

     var desc2 = new ActionDescriptor();

     var idnull = charIDToTypeID( "null" );

         var ref1 = new ActionReference();

         var idChnl = charIDToTypeID( "Chnl" );

         var idfsel = charIDToTypeID( "fsel" );

         ref1.putProperty( idChnl, idfsel );

     desc2.putReference( idnull, ref1 );

     var idT = charIDToTypeID( "T   " );

         var ref2 = new ActionReference();

         var idChnl = charIDToTypeID( "Chnl" );

         ref2.putName( idChnl, channel );

     desc2.putReference( idT, ref2 );

  executeAction( idsetd, desc2, DialogModes.NO );

}

JJMack
Inspiring
January 9, 2017

Hey

Yeah I know, but I was hoping I could do something like

selectionR = doc.channel[1].select.loadSelection()

selectionG = doc.channel[2].select.loadSelection()

selectionB = doc.channel[3].select.loadSelection()

do stuff with selectionR etc etc. So I can go back to it at will...