1 Reply Latest reply on Feb 6, 2010 7:03 AM by Michael L Hale

    How to Load Color Settings

    abusufiiyan

      Hi Friends,

       

                I'm trying to write a VB script to load the color settings. Can any one help me how to load the .csf file?

       

       

      Thanks in Advance,

      Abu

        • 1. Re: How to Load Color Settings
          Michael L Hale Level 5

          I can't give a VB example but it should be easy enough to do the same with VB.

           

          Put your color settings file in the Adobe/Color/Settings folder if it is not there already. You can use this to create an OS independent folder object.

           

          var colorSettingFolder = new Folder(app.preferencesFolder.parent.parent+'/Color/Setting');
          

           

          Then, with the file in that folder, use scriptlistner to load the settings.

           

          var idsetd = charIDToTypeID( "setd" );
              var desc27 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
                  var ref13 = new ActionReference();
                  var idPrpr = charIDToTypeID( "Prpr" );
                  var idcolorSettings = stringIDToTypeID( "colorSettings" );
                  ref13.putProperty( idPrpr, idcolorSettings );
                  var idcapp = charIDToTypeID( "capp" );
                  var idOrdn = charIDToTypeID( "Ordn" );
                  var idTrgt = charIDToTypeID( "Trgt" );
                  ref13.putEnumerated( idcapp, idOrdn, idTrgt );
              desc27.putReference( idnull, ref13 );
              var idT = charIDToTypeID( "T   " );
                  var desc28 = new ActionDescriptor();
                  var idNm = charIDToTypeID( "Nm  " );
                  desc28.putString( idNm, "mike" );// name of color settings file
              var idcolorSettings = stringIDToTypeID( "colorSettings" );
              desc27.putObject( idT, idcolorSettings, desc28 );
          executeAction( idsetd, desc27, DialogModes.NO );
          

           

          Of cource you can clean that up and make it into a function if you need to change setting often.

           

          EDIT: I just did a quick test and you don't need to put the file in the color settings folder first.

           

          var idsetd = charIDToTypeID( "setd" );
              var desc29 = new ActionDescriptor();
              var idnull = charIDToTypeID( "null" );
                  var ref14 = new ActionReference();
                  var idPrpr = charIDToTypeID( "Prpr" );
                  var idcolorSettings = stringIDToTypeID( "colorSettings" );
                  ref14.putProperty( idPrpr, idcolorSettings );
                  var idcapp = charIDToTypeID( "capp" );
                  var idOrdn = charIDToTypeID( "Ordn" );
                  var idTrgt = charIDToTypeID( "Trgt" );
                  ref14.putEnumerated( idcapp, idOrdn, idTrgt );
              desc29.putReference( idnull, ref14 );
              var idT = charIDToTypeID( "T   " );
                  var desc30 = new ActionDescriptor();
                  var idUsng = charIDToTypeID( "Usng" );
                  desc30.putPath( idUsng, new File( "C:\\Documents and Settings\\Mike\\Desktop\\test.csf" ) );
              var idcolorSettings = stringIDToTypeID( "colorSettings" );
              desc29.putObject( idT, idcolorSettings, desc30 );
          executeAction( idsetd, desc29, DialogModes.NO );