You are previewing Modding Mac OS X.
O'Reilly logo
Modding Mac OS X

Book Description

Modding Mac OS X isn't about cutting up your Power Mac's case with a saws-all; it's about modifying Mac OS X's user interface and unlocking secrets and dispelling your fears of the Unix command line so you can take command of your Mac.

Modding Mac OS X starts out with the very basics of showing you how to configure your Mac and do simple things like change Finder views, use an image from iPhoto's library on your desktop, and how to find and use screen savers. From there, Modding Mac OS X shows you how to:

  • Find hidden features in your favorite applications

  • Dive inside application bundles to find hidden resources

  • Change application and system-wide keyboard shortcuts

  • Work with the Property List Editor to read and edit property list files

  • Wrap your head around the defaults command to tweak an application's settings

  • Hack on NIB files to change an application's interface

  • Control an application with AppleScript, even if it isn't scriptable

Each Modding example includes detailed step-by-step instructions that even a novice Mac user can follow, while also providing the necessary detail to satisfy the experienced hacker. The knowledge you gain from tweaking one application can be easily applied to the next.

So go on, empower your inner Mac geek. You know you want to.

Table of Contents

  1. Modding Mac OS X
    1. About the Author
    2. Preface
      1. Goals of This Book
      2. Audience for This Book
      3. Organization of This Book
      4. Preparing to Dive
        1. Full Control (Chinese Take-Out Equivalent: Mild Vegetables in a Tasty Sodium-Controlled Light Wine Sauce)
        2. High Control (Chinese Take-Out Equivalent: Shredded Chicken with Garlic Sauce)
        3. Medium Control (Chinese Take-Out Equivalent: Kung Pao Beef)
        4. Master Geek (Chinese Take-Out Equivalent: Ma Po Tofu, Extra Spicy)
      5. Using Code Examples
      6. Conventions Used in This Book
      7. Comments and Questions
      8. Acknowledgments
      9. Disclaimer
    3. 1. Transforming Your Mac
      1. Desktops
        1. Using Mac OS 9’s desktop images
        2. Desktops that change
        3. Running a movie as the desktop image
        4. The matted-color bug
        5. Removing custom folders
      2. Screensavers
        1. iPhoto slideshows
      3. Altering the Dock
        1. Backing up your Dock
        2. Fun with TransparentDock
        3. Changing the Dock’s Poof
        4. Restoring the Dock
      4. Changing the Look of Finder Windows
      5. Customizing Standard Icons
      6. Custom Themes
      7. Changing the Boot Panel
        1. Back up the Boot Panel
        2. Reverting to the original Boot Panel
      8. Final Thoughts
    4. 2. Inside Application Bundles
      1. Application Bundles
        1. What’s inside the application folder
        2. Peeking inside applications
        3. Applications and the command line
      2. Understanding Bundle Structure
        1. Info.plist
        2. PkgInfo
        3. MacOS folder
        4. MacOSClassic folder
        5. Resources folder
        6. Frameworks
        7. Plugins folder
        8. SharedSupport folder
      3. Building Bundles
      4. Exploring the Resources Folder
        1. Viewing help files
        2. Viewing Mac OS X system resource files
        3. Using ResEdit to view .rsrc files
      5. Understanding Localizations
        1. Choosing localizations
        2. Peeking at NIB files
      6. Plug-ins
      7. Property Lists
      8. Shrinking Applications
        1. Removing languages with the Info panel
      9. Final Thoughts
    5. 3. Application Dumpster Diving
      1. The Xcode Tools
        1. Help and Xcode Tools
      2. Finding Goodies
      3. Changing Sounds
        1. Internationalizing sounds
      4. Searching Through Alternate Locations
        1. Search strategies
          1. Searching application folders
          2. Searching with the locate command
          3. Searching with inodes
          4. Searching frameworks
          5. Searching for common file types
      5. Finding and Changing Images
      6. Peeking at (and Playing with) String Files
          1. Looking at internationalized strings in TextEdit
          2. Example: Editing Calculator’s strings
        1. Using Unicode strings in TextEdit
      7. Final Thoughts
    6. 4. Changing Icons
      1. Mac OS X Icon Files
        1. Icons and extensions
        2. Icons and creator types
        3. Testing associations
      2. Viewing Icons
        1. Browsing system icons
      3. Creating Custom Icons
        1. Designing icons
        2. Recovering icon art
        3. Creating icons with Icon Composer
        4. Creating icons with tiff2icns
        5. Designing icons with third-party software
        6. Finding icons on the Internet
      4. Changing Icons
        1. Updating application icons
      5. Creating a Pseudo-Application
        1. Create document associations for your “app”
      6. Final Thoughts
    7. 5. Preferences Files
      1. Preferences Files
        1. Determining bundle identifiers
        2. Viewing preferences files in TextEdit
        3. Preferences file structure
          1. XML headers and containers
          2. The document type definition
        4. <integer>
        5. <real>
        6. <true/> and <false/>
        7. <string>
        8. <array>
        9. <data>
        10. <date>
        11. <dict>
      2. Managing Property Lists
        1. Creating property lists with Property List Editor
        2. Editing property lists with TextEdit
          1. Improving plist readability
        3. Creating property lists in TextEdit
      3. Real-World Preferences Files
        1. Changing Calculator’s preferences
      4. Discovering Undocumented Preferences
          1. Identifying preferences keys
          2. Searching for “Has” or “Is” attributes
          3. Testing preferences
      5. Final Thoughts
    8. 6. Discovering Domains and Support Files
      1. Folders
        1. Domains
          1. User domain
          2. System domain
          3. Local domain
          4. Network domain
        2. User domain folders
        3. Local and system domain folders
      2. Libraries and the Applications That Use Them
        1. Application support
      3. Preferences Domains
        1. Application domains
      4. Recovering Preferences Settings by Domain
        1. Discovering the defaults command and its documentation
        2. Learning to use the defaults command
        3. More fun with defaults
          1. Change the Terminal window’s opacity
          2. Detect the system beep sound
          3. Add a shadow to the Dock
      5. Final Thoughts
    9. 7. Changing Interface Elements
      1. Making Alterations
      2. Getting Ready to Hack
      3. Meeting Interface Builder
        1. NIB file window
        2. Palette
        3. Info window
        4. Window and menu editors
      4. Changing Window Styles
        1. Editing other attributes
      5. Adding a Tool Tip
      6. Adding an Item to the Contextual Menu
      7. Adding a New Button
        1. Making other connections
      8. Adding a Custom Drawer
        1. Adding content to the drawer
      9. Adding Objects from Another NIB File
      10. Changing Object Classes
      11. Restoring the Terminal Application
      12. Final Thoughts
    10. 8. Altering Keyboard Shortcuts
      1. Philosophy of Keyboard Shortcuts
      2. Panther’s New Keyboard Shortcuts Preferences Pane
        1. Disabling keyboard shortcuts
      3. Changing the Keyboard Shortcuts
      4. Adding Application Keyboard Shortcuts
        1. Adding a shortcut to an application
        2. Adding shortcuts with nonstandard characters
        3. Adding global application shortcuts
      5. Keyboard Shortcut Equivalents
      6. New Ways to Define Keyboard Shortcuts
        1. Creating an equivalence dictionary with Property List Editor
          1. Pushing the property list envelope
        2. Adding equivalencies with TextEdit
        3. Adding keyboard shortcuts with the defaults command
          1. Adding Unicode characters in the Terminal
      7. Speakable Items
        1. Preparing an application for speech
      8. Viewing Keyboard Shortcuts
      9. Final Thoughts
    11. 9. Basic Application Scripting
      1. Discovering Scriptable Applications
        1. Searching for scriptable applications
        2. AppleScript definition files
        3. The role of the scripting files
        4. Script suites
        5. Script terminology
        6. Viewing and editing scripting definition files
      2. Getting Ready to Script
        1. Firing up Script Editor
        2. Using Script Editor
      3. Talking to Applications
        1. Universal commands
      4. User Interface Scripting
        1. Preparing for UI Scripting
        2. Exploring user interface elements
        3. Exploring UI hierarchies
        4. Retrieving data
        5. Setting data
        6. Commanding UI elements
      5. General Application Scripting
        1. Using application dictionaries
        2. Elements and properties
        3. Misbehaving items
      6. Final Thoughts
    12. 10. Scripting the Unscriptable
      1. Activating Application Scriptability
      2. Expanding Suite Possibilities
        1. The problems behind script suite updates
        2. It’s all about class
        3. Extracting strings
        4. Adding classes and attributes to suites
        5. Adding attributes
      3. Updating the Core Suite
        1. A little history
        2. Getting started with NSCoreSuite
        3. Adding more window attributes
        4. alphaValue
          1. Settings
          2. Example
          3. Outcome
        5. backgroundColor
          1. Settings
          2. Example
          3. Outcome
        6. canHide
          1. Settings
          2. Example
          3. Outcome
        7. documentEdited
          1. Settings
          2. Example
          3. Outcome
        8. hasShadow
          1. Settings
          2. Example
          3. Outcome
        9. isAutodisplay
          1. Settings
          2. Example
          3. Outcome
        10. isExcludedFromWindowsMenu
          1. Settings
          2. Example
          3. Outcome
        11. miniwindowTitle
          1. Settings
          2. Example
          3. Outcome
        12. representedFilename
          1. Settings
          2. Example
          3. Outcome
      4. Reverting to the Original NSCoreSuite Files
      5. Final Thoughts
    13. Index
    14. Colophon