10 Replies Latest reply on Sep 11, 2015 12:39 PM by photogyulai

    How to see a preview of a UI slider in Photoshop

    photogyulai Level 1

      Hii !

       

      I know it is possible to see the preview of a slider in Photshop but i didnt find any solutiion about how?!?

      Im talking about scripting and ui window!

       

      So i have made this window with an Opacity slider... and after i press OK it isallright.

      And during slidemoving i see the opacity numbers changeing (at the layers palette) but not the picture!

      But i wanted to see the effect imidiatelly. (during slider move or mouse button release)

       

      Here is the code so far:

       

      var box = new Window('dialog', 'Opacity Slider',undefined);
        box.bounds = {x:300, y:300, width:450, height:200};
      
        box.panel = box.add('panel', {x:10, y:10, width:430, height:180}, ''); 
      
        var slider = box.panel.add("slider", {x:85, y:60, width:265, height:20}, 100, 0, 100);
      
        slider.onChanging = function () {e.text = (Math.round(slider.value))+'%'};
      slider.onChanging = function () {app.activeDocument.activeLayer.opacity = slider.value};
      
        box.okBtn = box.panel.add('button', {x:90, y:125, width:100, height:30}, 'Ok', {name:'ok'}); 
        box.cancelBtn = box.panel.add('button', {x:240, y:125, width:100, height:30}, 'Cancel', {name:'cancel'});
      
        box.cancelBtn.onClick = function() {   
          end = 0;   
          box.close();   
          } 
      
          box.okBtn.onClick = function() { 
        //Opacity
              app.activeDocument.activeLayer.opacity = slider.value
        box.close();
        }
      
      box.show ()
      

       

      Any help would be appreciated!

      Thanks