I designed spooky for me and my personal use. If you like the program, use it. Feel free to copy and adapt this script to your need - but please don't give it away without the little readme.txt.
Spooky is a an AppleScript, designed to give you the ability to handle front window size and position with your keyboard by using shortcuts to the script. You need another program like Butler or QuickSilver to do this. Spark is another hotkey starter.
You can resize your front window
- to full screen or
- to the four sides or
- to the edges of the screen.
You can move your front window
- to the center or
- to the sides or
- to the edges of the screen.
Furthermore you can grow or shrink your front window size to some special values. The window size will be set to the next bigger or smaller size
- 640 x 480
- 800 x 600
- 1024 x 768
- 1152 x 864
- 1280 x 960
- 1440 x 1080
- 1600 x 1200
- full screen.
By the way: you can set the resolution ratio in the script to 4:3, 16:10 or any value you like, so that it is possible
to get any window size you like.
If your dock is visible, its space will be reserved.
If you don't like the window fit till the border of the screen you can set a margin for the four sides of the screen (one for all).
spooky has an undo-function, which means, that if you e.g. maximize a window and "maximize" it again, it will resize to its original size and position. This works with every action except growing and shrinking your front window. The undo does not depend on the time between restarting the same action - only the window action and size is responsible. Have a try. Undo will slow down the speed of the script - so it is off as default. Set it to on in the scriptcode.
There are two shell scripts in spooky. spooky runs faster, if you set the two values derived by the shell scripts by hand: the screen resolution and the visibility of the dock. There are comments in the scriptcode "SET BY HAND ...".
If you don't like (this) script or this is to complicated to you, try GeekBind - a cocoa application for window movement and resizeing of the front window. If this is unavailable try the search function on http://www.sourceforge.net
spooky is a set of the following files - you can store them wherever you like.
- spooky.scpt - the actions itself
- spooky starter.scpt - the script to start spooky with
- spooky - test GUI scripting.scpt - script for testing a needed setting in Mac OS X
- spooky - readme.rtf - this file
- ~/Library/Preferences/net.doernte.spooky.plist - this file will be generated by spooky
First of all you must enable "access for assistance devices" - without this the script won't work (this is for GUI scripting).
Go to your system preferences and klick on "Universal Access" (the little white man in the blue circle :-) and enable "access
for assistance devices".
Alternatively you can try the script "spooky - test GUI scripting" - it will test and guide you through the process.
Zuerst muss der "Zugriff fuer Hilfsgeräte" aktiviert werden, sonst funktionieren die Skripte leider nicht.
In den Systemeinstellungen findet sich dies unter "Bedienungshilfen" (das kleine weisse Maennchen im blauen Kreis :-).
Ganz unten ist die gesuchte Option.
Alternativ kann man auch das Skript "spooky - test GUI scripting" verwenden - es testet die Option und Öffnet bei Bedarf die Systemeinstellungen.
Start the "spooky starter.scpt" script with the action you like (choose it within the script by uncommenting one line in the script). For the first time spooky starts it will ask you where you stored "spooky.scpt". Choose the script "spooky.scpt" - its path will be stored in a preference-file in ~/Library/Preferences/net.doernte.spooky.plist (your personal preference-folder). For the next time starting spooky with the starter-script the path will be read out of the preference file.
Using the script with hotkeys
Best you run the scripts within Butler or
QuickSilver with a Hotkey
(Spark is a good hotkey-starter too).
There is only one script "spooky.scpt" with all 20 actions in it. Then there is a second script "spooky starter.scpt" to start the wanted action. You must make a copy of the starter-script for every action you want need. Start the starter-script with a hotkey.
Then you have to choose the action at the beginning of the starter-script by uncommenting (and activating) the action you like the script to do.
Then you can asign hotkeys to the starter-scripts. A good idea is to assign the keys of your numberpad like
|ctrl + 7||move to top left||ctrl + Shift + 7||max to top left|
|ctrl + 8||move to top||ctrl + shift + 8||max to top|
|ctrl + 9||move to top right||ctrl + shift + 9||max to top right|
|ctrl + 4||move to left||ctrl + shift + 4||max to left|
|ctrl + 5||move to center||ctrl + shift + 4||max to full screen|
|ctrl + 6||move to right||ctrl + shift + 6||max to right|
|ctrl + 1||move to bottom left||ctrl + shift + 1||max to bottom left|
|ctrl + 2||move to bottom||ctrl + shift + 2||max to bottom|
|ctrl + 3||move to bottom right||ctrl + shift + 3||max to bottom right|
|ctrl + +||grow|
|ctrl + -||shrink|
On an iBook, Powerbook or MacBook (Pro) try the "num-keys" of the keyboard
|fn + ctrl + 7||move to top left||fn + ctrl + shift + 7||max to top left|
|fn + ctrl + 8||move to top||fn + ctrl + shift + 8||max to top|
|fn + ctrl + 9||move to top right||fn + ctrl + shift + 9||max to top right|
|fn + ctrl + U||move to left||fn + ctrl + shift + U||max to left|
|fn + ctrl + I||move to center||fn + ctrl + shift + I||max to full screen|
|fn + ctrl + O||move to right||fn + ctrl + shift + O||max to right|
|fn + ctrl + J||move to bottom left||fn + ctrl + shift + J||max to bottom left|
|fn + ctrl + K||move to bottom||fn + ctrl + shift + K||max to bottom|
|fn + ctrl + L||move to bottom right||fn + ctrl + shift + L||max to bottom right|
|ctrl + +||grow|
|ctrl + #||shrink|
Mac OS X 10.4 Tiger (testet)
But the script should work with other Mac OS X versions too - please tell me.
The scripts won't do anything.
- First of all you must enable "access for assistance devices" - without this the scripts won't work. Go to your system preferences and klick on "Universal Access" (the little white man in the blue circle :-) and enable "access for assistance devices".
- Zuerst muss der "Zugriff fuer Hilfsgeraete" aktiviert werden, sonst funktionieren die Skripte leider nicht. In den Systemeinstellungen findet sich dies unter "Bedienungshilfen" (das kleine weisse Maennchen im blauen Kreis :-). Ganz unten ist die gesuchte Option.
The scipts won't work with program xyz
- Please contact me - I will do my best tosupport program xyz.
Todo and known problems
Please send me a mail, if there are incompabilities or problems:
Do the same if you have any idea to optimize the script or to enhance its features.
Tell me about programs which doesn't work with these script.
- Spooky just works on one-monitior-systems. Spooky gets the monitor resolution by a shell script "system_profiler SPDisplaysdataType | grep resolution | sed 's|.*Resolution: ||' | sed 's|.x||'". On a one monitor-system the scripts give something like
- "1024 768" or
- "1280 960"
- "1024 768
- The goal will be a small single cocoa application like GeekBind, which runs on its own waiting for the hotkeys - but I don't know how to do it. If there is an idea - please tell me.
Maybe there are better ways to get the monitor resolution!?
History & What's new in this Version
Version 1.6.1 - 6-2006
Add comments to the script, where you can change something to run the script faster.
Version 1.6 - 5-2006
spooky can use standard zoom and unzoom function (green button on window top). Add functionality for Excel and PowerPoint.
Version 1.5 - 5-2006
spooky has an undo. If you start an action twice, the window will become its old position and size (except the actions "grow" and "shrink").
Version 1.4 - 5-2006
spooky has a starter script, so that the usability of the script is much better. "spooky.scpt" is the script with the function and "spooky starter.scpt" is the script, that will start the wanted action.
Version 1.3 - 5-2006
Now there is only one script - but with the full functionality (I learned how to use handles in AppleScript). Now you can choose the action of the script at its beginning by activating its action. This is a great job for maintenance of the script.
Version 1.2 - 5-2006
You can choose the windows ratio when you grow or shrink the front window. Choose any value you like, try 16:10 - or 4:3-sized windows. Set it manually at the begin of the scripts "window grow" and "window shrink" (since Version 1.3 there ist only one script - you can set the ration at the beginning of "spooky.scpt"). For better maintenance these values are at the beginning of every script - but with no functionality.
Version 1.1 - 5-2006
You can set a margin between the windows and the border of the screen, so that there is a little space between the windows and the screenborder. Set it manually at the begin of each script.
Version 1.0.1 - 5-2006
More move and max possibilities: You can move to the four edges and to the four sides of the screen. You can maximize to the four edges and to the four sides of the screen.
Version 1.0 - 5-2006
Same functionality - but easier code.
Version 0.2 - 5-2005
Even Word does its job :-)
Version 0.1 - 5-2006
First working scripts - only Word doesn't work :-(
How much does it cost?
Nothing, Spooky is completely free for personal use. If you use these scripts in a commercial environment,
please contact me.
Allthough writing these scripts is fun to me, I would be a happy man, if you honor my work. It took me hours of thinking and testing to wrote these spripts. If everyone who likes - an uses - these scripts very much, donates just 1 Euro or 1 $, I hopefully will get rich :-).
Send your Paypal donations to email@example.com.
These scripts were inspired by the small free Microsoft Windows-program FreeSnap. There is no Mac-version, so I wrote a this AppleScript based on a script from Michael Bach - found on www.apfeltalk.de.
Rights/Law - don't know how to name this
I am not related to Blue Onion Software, Microsoft or Apple, I'm just a user and I don't want to offend against any
rights of these companys and there trademarks - please tell me if I do so.
Butler, Quicksilver and Spark are just programs I had heard of (I use Butler - greetings to Peter Maurer :-) - I am not related to the authors.