Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[AS][CS5] Merge color channels

Explorer ,
Sep 29, 2011 Sep 29, 2011

Hi,

In Photoshop I have 4 grayscale files opened, each of them is a color plate for a CMYK file.

When going to the channel pallet, I have the option to choose "Merge Channels".

After doing so, I can choose the color space, and which file go's on which channel.

Does anyone know how to do to trigger this action AppleScript. How do I set the color mode and define which file go's on which channel?

Thanx

Kind regards

John

TOPICS
Actions and scripting
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Guru ,
Sep 29, 2011 Sep 29, 2011

Do the individual plate files have the standard naming convention… If so they should sort themselves if I recall correctly… Layers and channels have a merge command… It's been some time since I last did this so Im a bit vague… I'd need to go check…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 29, 2011 Sep 29, 2011

Hi Mark, Yes they do... It would be great to find out how to trigger the function. I have a "split channel" function but there is no "merge channel" function. I did find a "merge" function, but when running it using a list of channel objects, i did receive an error that I only could use spot channels.

I did find a workaround... It's far from pretty... It's so simple that some serieus applescript developer will smile for weeks when they read the code.

First I need to create a new file. Then ...

set the current document to document 1

   

tell the current document

     set current channels to channel 1

     select all

     copy

end tell

   

set the current document to document 5

   

tell the current document

     set current channels to channel 4

     select all

     paste

end tell

And this for all 4 color plates...

But It would be great if I could use the correct function...

Thanx

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Sep 30, 2011 Sep 30, 2011

I don't know how to do this in AppleScript, but what I would do in JavaScript if the grayscale images have the correct name is load the cyan image. Convert to multichannel. Load the other images and dupe them over to the cyan document in the correct order. Then convert the multichannel document into CMYK.

I can post the JavaScript if you like.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Sep 30, 2011 Sep 30, 2011
LATEST

Mike, I helped someone a far time back now do this… When I did it, it was something I had not used in Photoshop for many a year… Used to save all are images like this back in the days of 'color central' and the first/second version of Photoshop… I may have posted Incorrectly though… While I can now re-record with scriptlistener I can't avoid the two dialogs… I can't remember the workaround if there was one… CS5 won't let me click the OK boxes or key return… The merge command used with channels is for spot color channels only and not this purpose… I think I just passed the first part of the file name and as long as all the files had the correct suffix Photoshop calculated the made and the order… It kind of went like this…

set Merge_Channels to "mergeChannles( arguments[0] );

function mergeChannles( docName ) {

 

          function cTID(s) { return app.charIDToTypeID(s); };

          function sTID(s) { return app.stringIDToTypeID(s); };

                    var desc93 = new ActionDescriptor();

                    var list10 = new ActionList();

                    var ref32 = new ActionReference();

                    ref32.putName( cTID('Dcmn'), docName+'.Cyan' );

                    list10.putReference( ref32 );

                    var ref33 = new ActionReference();

                    ref33.putName( cTID('Dcmn'), docName+'.Magenta' );

                    list10.putReference( ref33 );

                    var ref34 = new ActionReference();

                    ref34.putName( cTID('Dcmn'), docName+'.Yellow' );

                    list10.putReference( ref34 );

                    var ref35 = new ActionReference();

                    ref35.putName( cTID('Dcmn'), docName+'.Black' );

                    list10.putReference( ref35 );

                    desc93.putList( cTID('null'), list10 );

                    desc93.putEnumerated( cTID('Md  '), cTID('ClrS'), cTID('ECMY') );

 

          executeAction( cTID('MrgC'), desc93, DialogModes.NO );

 

};"

tell application "Adobe Photoshop CS5"

  activate

  do javascript Merge_Channels with arguments {"Untitled-4"}

  delay 1

          tell application "System Events"

                    tell process "Adobe Photoshop CS5"

                              tell window 1

  click button 1

                                        delay 1

  click button 1

  end tell

  end tell

  end tell

end tell

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines