I have a CMYK document opened in photoshop. In "CHANNELS" panel, I just added 2 spot colors with the same name "Sport Color 1".
As I click any of the spot channel to select it, the "Listener" plugin will output some c++ code like below:
SPErr PlayeventSelect(/*your parameters go here*/void)
{
PIActionDescriptor result = NULL;
DescriptorTypeID runtimeKeyID;
DescriptorTypeID runtimeTypeID;
DescriptorTypeID runtimeObjID;
DescriptorTypeID runtimeEnumID;
DescriptorTypeID runtimeClassID;
DescriptorTypeID runtimePropID;
DescriptorTypeID runtimeUnitID;
SPErr error = kSPNoError;
// Move this to the top of the routine!
PIActionDescriptor desc0000000000003980 = NULL;
error = sPSActionDescriptor->Make(&desc0000000000003980);
if (error) goto returnError;
// Move this to the top of the routine!
PIActionReference ref0000000000001A48 = NULL;
error = sPSActionReference->Make(&ref0000000000001A48);
if (error) goto returnError;
error = sPSActionReference->PutName(ref0000000000001A48, classChannel, "Spot Color 1");
if (error) goto returnError;
error = sPSActionDescriptor->PutReference(desc0000000000003980, keyNull, ref0000000000001A48);
if (error) goto returnError;
error = sPSActionControl->Play(&result, eventSelect, desc0000000000003980, plugInDialogSilent);
if (error) goto returnError;
returnError:
if (result != NULL) sPSActionDescriptor->Free(result);
if (desc0000000000003980 != NULL) sPSActionDescriptor->Free(desc0000000000003980);
if (ref0000000000001A48 != NULL) sPSActionReference->Free(ref0000000000001A48);
return error;
}
-------------------------------------------
You can see "PutName" add the channel name "Spot Color 1" to reference, and I think it will not work correctly if I add such code to my project since PS cannot differentiate the 2 channels only by name. Can anyone tell me if there's any other method for selecting spot channel? Thanks in advance.
Hi Here is the something from docs tht you may find usefull. Tryusing index instead of name: Unfortunately I dont have C++ here to try i just used definition from docs. Hope that this help. Regards, Momir Zecevic Ars Media www.arsmedia.tvSPAPI OSErr(* PutIndex )(PIActionReference ref, DescriptorClassIDdesiredClass, uint32 value) Puts an index into a reference ( formIndex) along with the desired class for the reference.
North America
Europe, Middle East and Africa
Asia Pacific