My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

This project hosts Sandip Chitale's Mac OS X scripts and tools.


Mac Win Man - MWM for short - a unified Mac OS X Desktop Window and Application Manager

Works on Mac OSX Lion also

Features

  • Hide/Unhide Application
  • Minimize/Unminimize Window
  • Show window with same action no matter it was minimized or hidden
  • Zoom/Unzoom Window
  • Move and Resize (from all sides and corners) windows using keyboard and mouse
  • Tile Windows Vertically
  • Tile Windows Horizontally
  • Cascade Windows
  • Exposé Integration
  • Close Window
  • Quit Application

NOTE: The MWM tool requires that the System preferences > Universal access > Seeing > Enable access for assistive devices is checked.

Basically this tool combines the functionality of AWS and Move Resize tools below. The biggest improvement is that the combined tool uses the same server running in the background which provides a very fast response. There have been several minor bug fixes and enhancements also. And there is a new package based installer.

Screenshots

Switcher

TIP Type e to bring up Exposé. This works if you have default key shortcut of F9 to bring up Application Windows navigation of Exposé.

TIP Type F1 or ? to show the legend of available commands.

Move Resize

TIP Type ? to show the following help window.

Logo

Screencast

Slightly out of date

Download

MWM Package

Installation

After downloading the MWM Package double click to install it. Also make sure to add the /Applications/MWMServer.app to your login items to make sure it starts up when you log in.

How Switcher works?

The implementation uses Applescript to get the list of non background-only applications and their windows. It sends the list of applications and windows to a Java server which displays it in a JTable. When the user types the ENTER key or SPACE BAR the index of selected row is sent back to the Applescript over the STDOUT which activated the selected application and optionally brings the selected window forward un-minimizing it if required. Other commands are sent back in similar fashion.

How Move Resize 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 types 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.

TIP I use the Fastscripts Lite to associate keyboard shortcuts with the /Library/Scripts/Switcher.scptd and /Library/Scripts/MoveResize.scpt scripts.

TIP You can invoke the scripts using the Scripts menu in the menubar. If you do not have the scripts menu showing in the menu bar you can double click on the file /System/Library/CoreServices/Menu Extras/Script Menu.menu in Finder or execute open "/System/Library/CoreServices/Menu Extras/Script Menu.menu" in a terminal window.


Finder and Terminal Integration scripts

  • home.app - opens home folder in the Finder window. To installl drag and drop on Finder toolbar.
  • up.app - opens parent folder in the Finder window. To installl drag and drop on Finder toolbar.
  • terminalcd.app - opens a Terminal window cded to the current folder of the Finder window. To installl drag and drop on Finder toolbar.
  • copypaths.app - copies full paths of folders and files selected in the Finder window to the Clipboard. To installl drag and drop on Finder toolbar.
  • ToggleHiddenFiles.scpt - toggle showing of hidden files in Finder window. To installl drag and drop on Finder toolbar.
  • findercd.scpt - this scripts is used by fcd and fcda bash functions to switch the Finder window to the directory after switching the Terminal windows current directory.

Add the following bash functions to your ~/.bashrc file:

 
 # Change the directory of front window of
 # Finder to pwd of shell
 fcd() {
      cd "${1:-.}"
      osascript ~/scripts/finder/findercd.scpt "`pwd`" ${2}
 }

 # Change the directory of front window of
 # Finder to pwd of shell and activate the
 # Finder window
 fcda() {
      fcd "${1:-.}" true
 }

Screenshot

Screencast

Watch

Download Finder and Terminal Integration scripts

Extract the following zip in ~/scripts folder:

finder.zip


AWS - a unified A pplication and W indow S witcher i.e. Command TAB alternative

Obsolete See MWM

Screenshot

My other pet peeve with Mac OS X is how it deals differently with Applications and Windows that are minimized or hidden when one navigates using Command TAB( TAB)/Command Shift Tab ( TAB).

For me it does not matter if it is a window or application...I want to be able to switch to various windows where I want to work - hidden, minimized or what ever. Using Command TAB ( TAB)/Command Shift Tab ( TAB) to switch between applications and Command ~ ( ~)/Command Shift ~ ( ~) to switch between windows of an application is just plain wrong.

Once again, I was aggravated enough to make me write a tool to address just those issue. I wrote the AWS tool. Just download the AWS.zip, extract and drop the script bundle AWS.scptd in ~/Library/Scripts folder. You can either invoke the script from Scripts menulet in the Menubar or by adding a keybinding using QuickSilver or FastScripts.

NOTE: The AWS tool requires that the System preferences > Universal access > Seeing > Enable access for assistive devices is checked.

TIP If you do not have the scripts menu showing in the menu bar you can double click on the file /System/Library/CoreServices/Menu Extras/Script Menu.menu in Finder or execute open "/System/Library/CoreServices/Menu Extras/Script Menu.menu" in a terminal window.

TIP I use the Fastscripts Lite to associate a keyboard shortcut with AWS.scptd. It works great!

Download

AWS.zip

What's new?

TODO

  • I use Option+TAB ( TAB) as a key binding for AWS using FastScripts. However the current mechanism does not allow subsequent use of Option+TAB ( TAB) to navigate the list. Instead one has to use TAB or DOWN arrow. This needs to be handled better.
  • The order of applications should be sorted by most recently active criterion.

How it works?

The implementation uses Applescript to get the list of non background-only applications and their windows. It sends the list of applications and windows to a Java program which displays it in a JTable. When the user types the ENTER key or SPACE BAR the index of selected row is sent back to the Applescript over the STDOUT which activated the selected application and optionally brings the selected window forward un-minimizing it required.

Move and resize windows on Mac OS X

Obsolete See MWM

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 thing 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 make me write a tool to address just those issue. I wrote the MoveResize tool.

NOTE: The Move Resize tool requires that the System preferences > Universal access > Seeing > Enable access for assistive devices is checked.

What's new?

  • Better Installer.
  • Now you can directly enter location (x,y) and/or size (width,height) in the text fields and then type enter to move and/or resize the window.

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 types 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.

Screenshot

Screencast

Watch Screencast This one is for the older version.

Download

MoveResize.dmg

  • Double click on the diskimage
  • Copy the contents to ~/scripts/MoveResize folder

Quick Start

  • Invoke the MoveResize.app. This will start the MoveResize server. You can add the MoveResize.app to your login items in System preferences to have it started every time you log in.
  • Copy the MoveResize.scpt script to ~/Library/Scripts folder.
  • Create a new Finder window
  • Invoke the MoveResize script from the Scripts menu (Make sure you have turned on showing the Scripts menu in the menu bar using the AppleScript Utility app.). This will start the MoveResize tool. Move and resize the window using the mouse or keyboard arrow keys. While using the keyboard hold down the option or alt () key to resize the window. The default resize mode is grow mode. Type x to toggle between shrink mode and grow mode. The default delta for move or resize is 10 pixels. Hold down ctrl ( ) key to use delta value of 1 pixel. Hold down shift () key to use delta value of 100 pixels.
  • Invoke the QuitMoveResize script to terminate the MoveResize server.

TIP I use the Fastscripts Lite to associate a keyboard shortcut with MoveResize.scpt. It works great!

TIP YOu can execute the scritp from the Scripts menulet in the menu bar. If you do not have the scripts menu showing in the menu bar you can double click on the file /System/Library/CoreServices/Menu Extras/Script Menu.menu in Finder or execute open "/System/Library/CoreServices/Menu Extras/Script Menu.menu" in a terminal window.

Keyboard Shortcuts

History

I had implemented the original version using SWT. However, it turns out that it is implementable in Swing also - once again proving that Swing is a very good toolkit. Added advantage is that Swing is part of the JDK making the implementation much much smaller. BTW the Swing implementation is much faster and plays nicely with log off and shutdown.

Powered by Google Project Hosting