Skip to main content
September 28, 2009
Question

Loading color settings

  • September 28, 2009
  • 3 replies
  • 2408 views

I'm trying to write a startup script that checks what color settings are currently loaded and if they're not to "standard" ask the user if they want to update them to the standard settings. I've tried checking for the current setting using app.colourSettings but it returns "custom" rather than the name of the color settings that are loaded. What am I doing wromg?

Thanks

This topic has been closed for replies.

3 replies

September 28, 2009

Sorry, I should have said that the color settings I want to use are saved as a csf.

So, the first time Photoshop is opened it identifies that the color settings aren't "correct_color_settings.csf" and so loads it.

When Photoshop is next opened the color settings are set to "correct_colour_settings.csf" but app.colorSettings still returns "custom".

If I load the csf file from "C:\Program Files\Common Files\Adobe\Color\Settings" it seems to work however.

c.pfaffenbichler
Community Expert
Community Expert
September 28, 2009

This should get You the name of the current Setting:

#target photoshop

var ref = new ActionReference();

ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );

var appDesc = executeActionGet(ref);

var descColorSettings = appDesc.getObjectValue(stringIDToTypeID( "colorSettings" ));

var settingsName = descColorSettings.getString(charIDToTypeID( "Nm  " ));

alert(settingsName);

September 28, 2009

Christoph. This works if the csf is added to "C:\Program Files\Common Files\Adobe\Color\Settings" folder and loaded via the dropdown list, but if it's loaded from another location via the "load" command it gives an error 8500: The requested property does not exist.

Muppet_Mark-QAl63s
Inspiring
September 28, 2009

Custom is the result of a non pre-defined set of color settings. If you want to create a check then you need to save your set as a '.csf' file then you can test using your method. It will return the name of the current set if it is defined. Something like this…

#target photoshop

app.bringToFront();

if (app.colorSettings != 'Europe Prepress 2') {

alert('Your color settings are wrong!!!');

}

else {

alert('Your color settings are OK…');

}

c.pfaffenbichler
Community Expert
Community Expert
September 28, 2009

The Object Model Viewer in ESTK provides this:

»Application.colorSettings

Data Type: any

Adobe Photoshop CS4 Object Library

The name of the selected color setting's set.«

So it should be no wonder to get »custom« if the settings are not a saved set.

This might help:

var ref = new ActionReference();

ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );

var appDesc = executeActionGet(ref);

var descColorSettings = appDesc.getObjectValue(stringIDToTypeID( "colorSettings" ));

var rgbProfile = descColorSettings.getString(stringIDToTypeID("workingRGB"));

var cmykProfile = descColorSettings.getString(stringIDToTypeID("workingCMYK"));

alert(rgbProfile+"\n"+cmykProfile);