Loading ...
Sorry, an error occurred while loading the content.
 

[OT] Window management

Expand Messages
  • jrethorst
    Our trusty program, washed up on the shore of the Sea of the Forgotten Except by the Enlightened eras ago, has commands to manage windows effectively (and more
    Message 1 of 1 , Sep 18, 2009
      Our trusty program, washed up on the shore of the Sea of the Forgotten
      Except by the Enlightened eras ago, has commands to manage windows
      effectively (and more are in Tips & Macros here). The latest version of
      Safari, at least for Tiger, does not. I spend too much time on the web,
      and move windows around to compare things, and end up with a mess.
      This Applescript fixes that. You can edit the script to set the width of
      each window and its offset to the right of the window behind it. Best
      saved in Script Editor as a compiled script and run from the OS Script menu.

      John R.




      --set this number to the width in pixels that you want each window to be

      set windowWidth to 1000

      --set this number to the offset to the right of each window from the
      --window behind it

      set windowOffset to 50

      ----------

      tell application "Finder" to set screenBounds to bounds of ¬
      container window of desktop
      set screenWidth to item 3 of screenBounds
      set counter to 0

      tell application "Safari"
      activate

      repeat with i from (count windows) to 1 by -1
      set counter to counter + 1

      set windowPoint to windowOffset * (counter - 1)
      if windowPoint + windowWidth > screenWidth then
      set counter to 1
      set windowPoint to windowOffset * (counter - 1)
      end if

      set bounds of window i to {windowPoint, 22, ¬
      windowPoint + windowWidth, item 4 of screenBounds}
      end repeat
      end tell
    Your message has been successfully submitted and would be delivered to recipients shortly.