2 Replies Latest reply on Jan 8, 2017 8:06 PM by natrev

    Get file path for preloaded Color Setting

    natrev Level 3

      Hi

       

      I tired a lot and having the headache due to finding the file path for loaded color setting.

      First I know, is this possible to get loaded color setting path?

      Please suggest me.

       

      -yajiv

        • 1. Re: Get file path for preloaded Color Setting
          JavierAroche Level 3

          Hey natrev, try this:

           

          var ref = new ActionReference();
          ref.putProperty( stringIDToTypeID("property"), stringIDToTypeID("colorSettings") )
          ref.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );  
          var appDesc = executeActionGet(ref);
          
          var colorSettingsObject = appDesc.getObjectValue( stringIDToTypeID('colorSettings') );
          
          var colorSettingsPath = undefined;
          
          if( colorSettingsObject.hasKey( stringIDToTypeID('using') ) ) { 
               colorSettingsPath = colorSettingsObject.getPath( stringIDToTypeID('using') );
          }
          

           

          If you have a loaded color setting, the variable colorSettingsPath will return the path to the file, otherwise it will return undefined.

           

          Hope it helps!

          2 people found this helpful
          • 2. Re: Get file path for preloaded Color Setting
            natrev Level 3

            Hi JavierAroche,

             

            It is working like charm..

             

            -yajiv