Working Around OS X UI Bugginess By Restarting your Dock with AppleScript

4950 Since partially switching from OS X 10.5 Leopard the OS X 10.6 Snow Leopard on my 2.0 GHz aluminum MacBook a couple of months ago, I've been plagued (in Snow Leopard) with keyboard (both the built in and external USB keyboards) support crapping out erratically -- sometimes going several days with no problems; other days requiring two or more reboots to restore keyboard response.

On my machine, this exasperating bug has manifested mainly when switching between Desktop Spaces using keyboard shortcuts. The little grid-type Spaces transition screen sometimes (but not always) will freeze on the display.

Spaces are, as I understand it, closely integrated with the Dock, which itself has been known to lock up, although I haven't had that issue?

Anyway, I've learned that one thing to try in aid of to clearing up the problem without a reboot or logout is to quit the Dock, since OS X will recognize that the Dock isn't running and helpfully restart it for you. Unfortunately, Apple has not seen fit to provide a handy, GUI-based means of quittng and restarting the Dock, analogical to the Finder Relaunch command in the Force Quit window.

Happily, doing a bit of online digging turned up a great little tutorial article posted way back in 2002 on the Mac Net Journal site by Rob McNair-Huff, with instructions on how to implement easy Dock restarting with one click, enlisting the help of a simple AppleScript.

You just have to create a very simple AppleScript using OS X's bundled ScriptEditor utility (Applications > AppleScript > Script Editor), save it as an OS X applet and drop it it in the Scripts folder (Scripts menulet > Open Scripts Folder or drag it to either HardDrive > Library > Scripts or HardDrive > Users:username > Library > Scripts ) where it can be accessed when you need to quit and restart the Dock.

image


The Script Menu appears on the menu bar on the top of your screen (if you don't see it, open the Scripts Utility (Application > Applescript > Scripts Utility) and make sure the "Show Script Menu in menu bar" checkbox is checked), from where you can conveniently access your applet.

To create your Dock quit applet, open the Applications folder and find the AppleScript folder, double click on Script Editor, and when the program opens, type: quit application "Dock" in the window text field. That's your AppleScript soon-to-be applet.

image


Save the new script an OS X applet, store the saved applet in the Scripts folder, and if you wish drag its icon to the Dock to create a one-click shortcut and you're done.

you can find Rob McNair-Huff's Mac Net Journal tutorial here:
http://bit.ly/9RjU8F


Charles W. Moore



Tags: Blogs ď Hands On Mac ď Hot Topics ď

Login † or † Register † †

Follow Us

Twitter Facebook RSS! http://www.joeryan.com Joe Ryan

Most Popular

iPod




iPhone

iLife

Reviews

Software Updates

Games

Hot Topics

Hosted by MacConnect - Macintosh Web Hosting and Mac Mini Colocation                                                    Contact | Advanced Search|