- AWS - a unified A pplication and W indow S witcher i.e. Command TAB alternative
- Move and resize windows on Mac OS X
- Finder and Terminal Integration scripts
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:
- how Mac is different than Windows
- Command Tab is for switching between applications but a window on Mac maps to a document and not an application and so on
- how minimized windows are different than hidden windows
- if you don't like how Mac works...buzz off...in one form or another
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
What's new?
- Now integrated with Move Resize tool
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
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
- 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.
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
Download Finder and Terminal Integration scripts
Extract the following zip in ~/scripts folder: