Skip to main content
Known Participant
December 8, 2022
Answered

Read and change InDesign "Color settings" preferences from plugin C++ (SDK)

  • December 8, 2022
  • 4 replies
  • 1807 views

Hi, 

 

Is it possible read and change InDesign Color preferences from C++ plugin?
I would like to handle profil settings.

 

Best regards

Karoly

This topic has been closed for replies.
Correct answer rob day

Hi Karoly, Not sure if this helps with the SDK, but with JavaScript you set the application and document color management settings like this:

 

//sets the application Color Settings:
app.colorSettings.properties = {cmykPolicy:ColorSettingsPolicy.COMBINATION_OF_PRESERVE_AND_SAFE_CMYK, 
    mismatchAskWhenOpening:false, 
    mismatchAskWhenPasting:false, 
    missingAskWhenOpening:false, 
    rgbPolicy:ColorSettingsPolicy.PRESERVE_EMBEDDED_PROFILES, 
    workingSpaceCMYK:"Coated GRACoL 2013", 
    workingSpaceRGB:"Adobe RGB (1998)"}

//sets the active document’s color management:
app.activeDocument.properties = {rgbProfile: "Adobe RGB (1998)", 
    rgbPolicy: ColorSettingsPolicy.PRESERVE_EMBEDDED_PROFILES, 
    cmykProfile:"Coated GRACoL 2013", 
    cmykPolicy:ColorSettingsPolicy.COMBINATION_OF_PRESERVE_AND_SAFE_CMYK}

4 replies

Community Expert
January 16, 2023

Hi all,

like to add that one should look into this script by Roland Dreger:

Color Script 1.0.8

https://www.rolanddreger.net/de/1/farbmanagement-in-adobe-indesign/#

 

The GUI should be in English with a non-German InDesign…

 

Regards,
Uwe Laubender
( Adobe Community Expert )

c4kaciAuthor
Known Participant
January 16, 2023

I will check it.
Thank you Uwe!

c4kaciAuthor
Known Participant
January 24, 2023

Than you for all response!

Best Regards
Karoly

Legend
December 8, 2022

For documents, there is kSetDocProfilePolicyCmdBoss. I did not find an interface for IID_ISETDOCPROFILEPOLICYCMDDATA though, so a script request might actually be a good idea.

c4kaciAuthor
Known Participant
December 9, 2022

I will check it a little later (in January) because I take trip.
Thank you Dirk and Rob!

Legend
December 8, 2022

Use kColorPresetsSettingsSetCmdBoss / IID_ICOLORPRESETSSETTINGSDATA for the app workspace.

ItemList is empty.

How would you do the document changes shown by Rob in the UI? Is that document setup >> intent?

rob day
Community Expert
Community Expert
December 8, 2022

How would you do the document changes shown by Rob in the UI?

 

Hi Dirk, There isn’t a way to directly set a document’s color management policies in the UI the way you can with javascript. To change an existing doc’s policies via the UI you have to close the document, open Color Settings, check Ask When Opening, open the document and follow the change prompts—it’s a pain, I use a script to do it.

 

I would think the SDK would also have a way to directly set the document’s policies—the equivalent of

 

app.activeDocument.rgbPolicy = ColorSettingsPolicy.PRESERVE_EMBEDDED_PROFILES

 

Legend
December 8, 2022

To figure these things out I run the debug build of InDesign, including a home-grown plug-in that produces tons of debug output and just perform the action in the UI. I must admit I just was too lazy to get VSCode going, create a jsx file and run your script. Also from an IDUG session years ago I faintly remember there was a way to get to this setting, could maybe have been per image. I also think the overall message was to use Bridge to change the setting across the Suite.

rob day
Community Expert
rob dayCommunity ExpertCorrect answer
Community Expert
December 8, 2022

Hi Karoly, Not sure if this helps with the SDK, but with JavaScript you set the application and document color management settings like this:

 

//sets the application Color Settings:
app.colorSettings.properties = {cmykPolicy:ColorSettingsPolicy.COMBINATION_OF_PRESERVE_AND_SAFE_CMYK, 
    mismatchAskWhenOpening:false, 
    mismatchAskWhenPasting:false, 
    missingAskWhenOpening:false, 
    rgbPolicy:ColorSettingsPolicy.PRESERVE_EMBEDDED_PROFILES, 
    workingSpaceCMYK:"Coated GRACoL 2013", 
    workingSpaceRGB:"Adobe RGB (1998)"}

//sets the active document’s color management:
app.activeDocument.properties = {rgbProfile: "Adobe RGB (1998)", 
    rgbPolicy: ColorSettingsPolicy.PRESERVE_EMBEDDED_PROFILES, 
    cmykProfile:"Coated GRACoL 2013", 
    cmykPolicy:ColorSettingsPolicy.COMBINATION_OF_PRESERVE_AND_SAFE_CMYK}
c4kaciAuthor
Known Participant
December 8, 2022

Hi Rob,

Thank you for your quick answer.
If I can't find a specific SDK solution, I'll try to call it from the C++ plugin.