6 Replies Latest reply on Apr 5, 2017 5:16 AM by Laubender

    IDCS2 Win:  Why doesn't the dialog reflect the change?

    JADarnell Level 1
      Hello Everyone:

      I am building this short script that is meant to reset color settings to a uniform Company-wide standard:

      ****************** code starts here *****************
      app.colorSettings.enableColorManagement = true;

      var ListLength = app.colorSettings.cmsSettingsList.length;
      var a;
      for(a = 0; a < ListLength; a++)
      {
      if(app.colorSettings.cmsSettingsList[a] == "IDCS2_WPC1")
      break;
      }

      if(a >= ListLength)
      {
      alert("Warning: IDCS2_WPC1 is not in your Color Settings list. Please have Production Support install it.");
      exit();
      }

      app.colorSettings.cmsSettings = "IDCS2_WPC1";

      app.colorSettings.cmykPolicy = ColorSettingsPolicy.preserveEmbeddedProfiles;
      app.colorSettings.rgbPolicy = ColorSettingsPolicy.preserveEmbeddedProfiles;

      ****************** code ends here *****************

      As far as I can tell, app.colorSettings.cmsSettings maps to the "Settings" field on the Color Settings dialog under the Edit
      drop down menu. Yet, when I finish executing this script and call up the Color Settings dialog, the Settings field is still set to
      "Custom." So what am I missing here? Is there an extra step that I need to perform?

      FYI, the for loop breaks on about the fifth loop; evidence that the settings file that I am looking for exists.

      TIA!

      John
        • 1. Re: IDCS2 Win:  Why doesn't the dialog reflect the change?
          Level 1
          Are you doing this with or without a document open? You're addressing the application preferences, but don't these operate at the document level?

          Dave
          • 2. Re: IDCS2 Win:  Why doesn't the dialog reflect the change?
            JADarnell Level 1
            Hi Dave:

            I do have a document open. Looking at the object model, however, colorSetting is found under "app," not "activedocument."

            Nevertheless, I will try app.activedocument.colorSetting...

            And thanks for looking at this.

            R,
            John
            • 3. Re: IDCS2 Win:  Why doesn't the dialog reflect the change?
              Level 1
              But document objects do have a cmykPolicy property.

              This is an area I've never thought much about, so I could be all wet.

              Dave
              • 4. Re: IDCS2 Win:  Why doesn't the dialog reflect the change?
                JADarnell Level 1
                Dave:

                I tried adding
                b activeDocument
                to all the appropriate designations and the script didn't like them. By that I mean that the script errored out in ExtendScript. Here's the message I received:

                b Object does not support the propert or method 'colorSettings'

                That was received after executing this line (the first line in the script):

                b app.activeDocument.colorSettings.enableColorManagement = true;

                Perhaps I was doing something wrong?

                R,
                John
                • 5. Re: IDCS2 Win:  Why doesn't the dialog reflect the change?
                  JADarnell Level 1
                  Hello All:

                  Mystery resolved.

                  It turns out that after the script changes the value of cmsSettings with this statement:

                  b app.colorSettings.cmsSettings = "AValidString";

                  when it executes either one of these two statements:

                  b app.colorSettings.cmykPolicy = ValidPolicySetting;

                  b app.colorSettings.rgbPolicy = ValidPolicySetting;

                  InDesign changes cmsSetting back to "Custom."

                  As far as I can tell, this little behavior quirk is not listed anywhere in the documentation.

                  Thanks Dave, for your help.

                  R,
                  John
                  • 6. Re: IDCS2 Win:  Why doesn't the dialog reflect the change?
                    Laubender Adobe Community Professional & MVP

                    Hi there,

                    I know, this is a very old thread from 2008, but the basic principles of setting colorSettings remain until today even with InDesign CC 2017. And since I'm currently doing work with exactly that I came accross this one here.

                     

                    You are saying:

                    As far as I can tell, this little behavior quirk is not listed anywhere in the documentation.

                    This is no quirk. It's expected behavior. Changing values on properties that are directly related to the "Color Settings" window is changing the name of the currently applied csf file in the UI to "Custom". It's the same like you are doing a change of the setting in the UI. The value of cmsSettings will immediately turn to an empty string: "" (EDIT*)

                     

                    If you want no change to "Custom" you either have to change the csf file by e.g. loading it to PhotoShop, doing your changes and save anew with the same name or you have to do a totally new csf file with the new values and apply that to cmsSettingsPath. That would work provided color management is turned on. You could ensure that with app.colorSettings.enableColorManagement set to true.

                     

                    FWIW: There is another old thread about a related problem where the original poster wanted to change the value to "Custom" deliberately: Color Settings

                     

                    I'll comment on that later…

                     

                    Regards,
                    Uwe

                     

                    // EDIT: The empty string will be only there if you turn on color management if it was turned off.
                    If color management is turned on and you change the value of e.g. useBPC from false to true, the UI will show "Custom", but cmsSettings will stay with the same value as before.