2 Replies Latest reply on Nov 8, 2017 3:00 PM by rin70588324

    [Q] Smoothing Toggle Script

    rin70588324

      Hi guys,

       

      I'm not a programmer but I think this is the best section to ask this.

       

      I'm wondering if it's possible to create a small JS script to toggle on/off the new Smoothing option in Photoshop CC 2018.

       

      Thanks for reading!

      R.

        • 1. Re: [Q] Smoothing Toggle Script
          r-bin Level 5

          // try this

           

          toggle_smoothing();

           

          ////////////////////////////////////////////////////////////////////////////////////////// //

          function toggle_smoothing()

              {

              try

                  {

                  var r = new ActionReference();

                  r.putProperty( charIDToTypeID( "Prpr" ), stringIDToTypeID( "tool" ) );

                  r.putEnumerated( charIDToTypeID("capp"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );

           

                  var ret = executeActionGet(r);

           

                  var desc = ret.getObjectValue(stringIDToTypeID("currentToolOptions"));             

           

                  if (desc.hasKey(stringIDToTypeID("smoothing")))

                      {

                      var smooth = desc.getBoolean(stringIDToTypeID("smoothing"));

           

                      var tool = ret.getEnumerationType(stringIDToTypeID("tool"));

           

                      desc.putBoolean(stringIDToTypeID("smoothing"), !smooth);

           

                      var r = new ActionReference(); 

                      r.putClass( tool ); 

           

                      var desc2 = new ActionDescriptor(); 

                      desc2.putReference( stringIDToTypeID( "null" ), r ); 

           

                      desc2.putObject( stringIDToTypeID( "to" ), stringIDToTypeID( "null" ), desc ); 

                      executeAction( stringIDToTypeID( "set" ), desc2, DialogModes.NO );

                      }

                  else

                      {

                      alert("Tool with no smoothing!");

                      }

                  }

              catch (e) { alert(e)  }

              }

          1 person found this helpful
          • 2. Re: [Q] Smoothing Toggle Script
            rin70588324 Level 1

            It works! Thank you very much r-bin!

            I really appreciate the time you took to write the script.

             

            You saved my life! <3