3 Replies Latest reply on Mar 23, 2015 5:51 AM by JJMack

    How to Minimize Window Dialog

    bala281972 Level 1

      I'm creating a dialog window for PS CS6. Is there any way to minimize the window and then do some work in photoshop, once that gets completed bring back the same minimized window (other way round maximize window) when the user presses a predefined keys ? Is this possible ?

       

      app.preferences.rulerUnits = Units.PIXELS;
      var guides=app.activeDocument.guides;
      var win = new Window ('dialog', 'Dialog Name');
      win.grpButtons = win.add('group');
      win.grpButtons.orientation='column'
      win.grpButtons.alignChildren = 'fill';
      win.grpButtons.pnl1 = win.grpButtons.add('button', undefined, 'Step1');
      win.grpButtons.pnl2 = win.grpButtons.add('button', undefined, 'Step2');
      win.grpButtons.pnl3 = win.grpButtons.add('button', undefined, 'Step3');
      win.grpButtons.pnl4 = win.grpButtons.add ('statictext', undefined, 'Click on the steps to proceed');
      win.size = {width: 240, height: 150}
      var result = win.show();
      win.grpButtons.pnl1.onClick=function(){
      var result1 = win.minimize();
      app.bringToFront();
              }
      
        • 1. Re: How to Minimize Window Dialog
          JJMack Most Valuable Participant

          You can make the dialog an interactive process where some the user interaction can cause the dialog to close the script could do some processing and then redisplay the dialog or an updated dialog. The Dialog window would be closed the user would not have a minimized window to mamazise the script would be in control the user out of the picture till the script displays a dialog or the users cancel execution.  The user user interaction need not close the dialog it could cause the script to update the dialog. For example if you download the Image Processor Pro script.  You can add tabs to the dialog via user interaction.

           

          When a script has an open dialog the dialog has focus the user can interact with it but not with Photoshop. The user can interact with the OS and other Running programs.  However the Active Photoshop application Script Process is running and the current script being run has an open dialog has focus the user must interact with it.

          • 2. Re: How to Minimize Window Dialog
            bala281972 Level 1

            That's cool JJ. Any suggestion on how to transfer control from JS to PS and bring it back please ?

            • 3. Re: How to Minimize Window Dialog
              JJMack Most Valuable Participant

              bala281972 wrote:

               

              That's cool JJ. Any suggestion on how to transfer control from JS to PS and bring it back please ?

              I  do not know if that can be done.  The would be more like having two scripts   Script 1 then user use Photoshop then Script 2.

               

              However you can make script interactive like actions can have interactive steps.    You can prompt user for information and you can make interactive steps.  For example you can open a files selection dialog when the user can navigate to the file(s) that they want to script to process.  If the user selects a file(s) the script will get a file or file list or a cancel or no no selection.  The script can the do what would be appropriate.

               

              For example say you want to help a user populate a collage template psd interactively in the script you could highlight the image areas to be populated then open a file selection dialog that would allow the user to select one image file of supported image file types. If the user select a file the script could place in the image. Size the place image smart object to fill the image area, Position the image layer over the area and mask off any excess. Then the script  put the user into an interactive transform layer dialog where the user can tweak or accept the image composition within the masked area. tweak the virtual image crop change the image composition and scale. Once the user commits the transform the script would move on the the next image placement.