Mac Kung Fu: Breaking the Magician’s Code Uncovering “Default Write” Commands by Keir Thomas Keir breaks the magician’s code and reveals useful secrets that Apple has hidden in its code. Authors get asked the same questions time and again. Mine? People ask where I find the hints, tips, tricks, and hacks that fill Mac Kung Fu [U1], the second edition of which was published last month. I’m tempted to steal a joke from Douglas Adams who, when asked where he got the zany ideas for his Hitchhiker’s books, said it was via mail order from a firm in Indianapolis. I wish finding the tips were that easy. The trick is to develop methodologies for uncovering interesting new things. All involve exploration, trial and error, and a healthy helping of intuitive guesswork. Some methodologies are complicated. Some are simple. As just one example of how simple they can be, it’s genuinely surprising how many hidden features in OS X can be uncovered simply by clicking things on screen while holding down the Option key (a.k.a. the Alt key for international users). Hold down Option while clicking and dragging to resize the Dock and it’ll snap to preset sizes. Hold down Option while clicking the Notification Area icon in Mountain Lion and you’ll turn off notifications until tomorrow. I click everything with Option held down so—to borrow a phrase—you don’t have to! One thing’s certain: The “Wow!” moment of discovery can be addictive. Default Choices An example of a more complicated methodology is uncovering the “default write” commands that form part of the book, and part of Mac power-user culture. These are commands typed into a Terminal window that write secret and/or unofficial settings and thereby unlock hidden features within apps. Default write hacks can transform the user experience by fixing annoyances and introducing new functionality. For some reason, many built-in OS X apps feature such hidden gems. But perhaps some explanation is necessary. Whenever a Mac program starts, it reads its settings from one or more property list files. These are similar to config/.ini files, as found on lesser operating systems, although within OS X they’re binary files that can be decoded to and from human-readable XML. Apple prefers things to be neat and tidy. Any user selections made within an application’s Preferences dialog box are stored in one of these files, which have a .plist extension. They live in the /Library/Preferences, or ~/Library/Preferences folders. However, with most of OS X’s built-in applications—such as Finder or the Dock—there are quite a few secret preference “keys” you can write to the .plist files that activate features or change settings you can’t access via Preferences dialog boxes, or System Preferences. PragPub January 2013 22
Purchased by unknown, nofirst nolast From: Scampersandbox (scampersandbox.tizrapublisher.com)