My favorites | Sign in
Logo
                
Code license: New BSD License
Labels: MacOSX
People details
Project owners:
  sandipchitale

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


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

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

When on asked about any alternatives to Command Tab behavior, frequently Mac-heads respond condescendingly about:

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

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

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?

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

Quick Start

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.


Finder and Terminal Integration scripts

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









Hosted by Google Code