Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

241
Visualizações
How to paste clipboard into a channel using a photoshop script?

I'm trying to create a image RGB or CMYK using separate greyscale documents for each channel. My current code copy all from greyscale document and paste in a new document creating a new layer for eachone. I don't want that, I want copy from each document and paste into eachone channels new document, same as manual way, selecting each channel and clicking Edit->paste->paste especial->paste in place.

// Loop to copy each separate channel into a new merged document
for (var doc_index = 0; doc_index < 3; doc_index++ ){
//Switch documents 
app.activeDocument = split_channels[0];

// copy active layer from separate channel document
app.activeDocument.selection.selectAll();
app.activeDocument.selection.copy();

// close document whithout save 
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

//select activeDocument
app.activeDocument = mergedDoc;

// reference to whole channels
//var channelIndex = doc_index;
var myChannels = app.activeDocument.channels;

// the channel must be visible to paste greyscale layer
myChannels[doc_index].visible= true;

// turn off the rest of channels    
for (var secondaryIndex = 0; secondaryIndex < myChannels.length; secondaryIndex++) {
    
    if (doc_index != secondaryIndex) {
        
        myChannels[secondaryIndex].visible= false
    }
}

//paste layer for each new document channel (no works correctly)
app.activeDocument.paste();
    
//reset the channel count after copy and close each document
var split_channels = app.documents;
}

thanks a lot for any suggestion

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda