4 Replies Latest reply on Jun 10, 2011 8:01 AM by praveen mds

    Script for mode change

    praveen mds Level 1

      Hi,

      i'm using this script for converting my files to RGB mode. I faced some issues on using this with photoshop CS.

      convertRGB ()
      function convertRGB()
      {
      var eventModeChange = stringIDToTypeID( "8cba8cd6-cb66-11d1-bc43-0060b0a13dc4" );
      var descSource = new ActionDescriptor();
      var keyRGB = charIDToTypeID( "RGBM" );
      var keyDestination = charIDToTypeID( "DstM" );
      var descDest = new ActionDescriptor();
      descSource.putObject( keyDestination, keyRGB, descDest );
      executeAction( eventModeChange, descSource, DialogModes.NO );
      }
      

       

      is there any other way to make the convertion of any mode to RGB with script? especially with photoshop CS.

       

      thanks

       

      Praveen

        • 1. Re: Script for mode change
          c.pfaffenbichler Level 9

          I only have CS5 on this station and I suspect a reason for not getting reactions so far may be that others may not have CS installed anymore, either.

           

          I faced some issues on using this with photoshop CS.

          What issues?

          Have you tried wrapping it in a try-clause?

          Is convertProfile available in CS?

          • 2. Re: Script for mode change
            MTSTUNER Level 6

            Have you tried using the Script Listener in photoshop cs?

             

            This is the output from the script listener for converting to the RGB

            color mode without any dialog:

             

             

            // =======================================================
            var id11 = charIDToTypeID( "CnvM" );
                var desc4 = new ActionDescriptor();
                var id12 = charIDToTypeID( "T   " );
                var id13 = charIDToTypeID( "RGBM" );
                desc4.putClass( id12, id13 );
                var id14 = charIDToTypeID( "Fltt" );
                desc4.putBoolean( id14, false );
            executeAction( id11, desc4, DialogModes.NO );

             

             

             

             

            MTSTUNER

            • 3. Re: Script for mode change
              praveen mds Level 1

              On running that script in CS i got dialog box of "conditional mode change". For each file this dialog box appears. But using this script in other versions i.e CS2, CS4, CS5 it works well. unfortunately i need to use it in CS vertion of photoshop.

               

              Untitled-2.jpg

              • 4. Re: Script for mode change
                praveen mds Level 1

                Thanks MTSTUNER,

                 

                It works well..

                 

                Thanks again...