Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An AppleScript/Java solution to move and resize windows System
I have been always extremely annoyed by the fact that one cannot resize the windows on Mac OS X using all four edges of the window. In fact, that is one of the most aggravating things for me about using a Mac. Another issue is that one cannot use the keyboard to move and resize the windows. I was aggravated enough to write a tool to address just those issues: MoveResize (free and open source). The MoveResize tool requires that System Preferences » Universal access » Seeing » Enable Access for Assistive Devices is checked.

How it works:

The implementation uses AppleScript to get the frontmost window and its bounds. It sends the bounds rectangle to a server implemented in Java over a socket connection. The Java server takes the screen shot of the full Desktop and uses it as the Image label (a JLabel with ImageIcon) as the content pane of an undecorated JFrame which has the same bounds as the Desktop.

A JPanel with semitransparent background and a dark rounded rectangular border is given the same bounds that were received over the socket. This JPanel is added to the PALETTE_LAYER of the JFrame's layered pane - which makes it appear floating in front of the front window.

A Mouse and a Key listener added to the JPanel allow moving and resizing of the JPanel. When the user presses the Enter key, the JFrame is hidden and the new bounds of the JPanel are sent back to the AppleScript over the socket connection, which moves and resizes the frontmost window. You can also directly enter location (x,y) and/or size (width,height) in the text fields, and then press Enter to move and/or resize the window.

[robg adds: I tested this and it works, though it requires that the MoveResize app is in the main Applications folder. Other solutions I'm aware of, both free and non-free, include Zooom/2, this AppleScript-based hint, MercuryMover, and MondoMouse -- though I'm sure there are others.]
  • Currently 1.14 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)

An AppleScript/Java solution to move and resize windows | 2 comments | Create New Account
Click here to return to the 'An AppleScript/Java solution to move and resize windows' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript/Java solution to move and resize windows
Authored by: GenesysX on Jul 23, '09 08:32:26AM
Check out this for free and paid app. I've found it very useful.

Chris Andrews

[ Reply to This | # ]

An AppleScript/Java solution to move and resize windows
Authored by: beheadedmyway on Jul 27, '09 01:39:15AM

A really cool app - "Afloat" you can resize and move windows with key modifiers.

ctrl+cmd+(Mouse Right Click) -> resize the active window (regardless of where the mouse is).

ctrl+cmd+(Mouse Left Click) -> move the active window -> you can click anywhere in the window and it moves like grabbing the titlebar.

Therea re some other sweet features, you'll have to read the pdf that comes with Afloat for more secrets.

[ Reply to This | # ]