7 Replies Latest reply on Aug 8, 2010 5:28 PM by PaulR72

    [JS, CS4] Document window resizing

    PaulR72

      Hello all

       

      Having trouble re-sizing the main document window with the below script fragment. Used to work perfectly in CS3. In CS4, if the document window is maximised and then the script is run, it works: it makes the window smaller. If the doc window is smaller than the maximum size and the script is run, it maximises the doc window: it doesn't make it the size specified in the script. In other words, every second time the script is run it works; the other times, it maximises the doc window. Have tried using smaller values for the win size, but doesn't matter what the values are.

       

      Any idea what's going wrong? It's a bit of an annoying glitch for me ...

       

      ===

      const left = 0;  const top = 50; const right = 200; const bottom = 200;

       

      win = doc.layoutWindows[0];

      var bounds = win.bounds;
      bounds[0] = top;   bounds[1] = left;   bounds[2] = bottom;   bounds[3] = right;
      win.bounds = bounds;

      ===

       

      I've tried making the above variable win point to app.activeWindow instead -- still doesn't work.

       

      Hope someone can help...


      Paul