Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!