How to Get a list of Printer Color Profiles

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

Dimatokis
Posts: 11
Joined: Wed Aug 17, 2016 7:50 pm

How to Get a list of Printer Color Profiles

Post by Dimatokis »

Hi!

How I can get a list of printer color profiles? Same as in the print dialog. It is possible?
JavierAroche
Posts: 29
Joined: Sat Jul 30, 2016 3:52 am
Location: San Francisco

Re: How to Get a list of Printer Color Profiles

Post by JavierAroche »

I don't see a list of the print color profiles exposed in the document model (maybe it's under application?). I was only able to get the current active profile :(

NOTE: Only works if "Color Handling" is set to "Photoshop Manages Colors" in the print settings. Otherwise the printer profile is false, and therefore will throw an error.

Code: Select all


// Get document Action Descriptor
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);

// Get printer output object
var printerOutput = desc.getObjectValue( stringIDToTypeID('printOutput') );

try {
var printerProfile = printerOutput.getString( stringIDToTypeID('name') );
alert( printerProfile );
} catch(err) {
alert( 'Set Color Handling to Photoshop Manages Colors to get the current Printer Profile' );
}