How can I edit the user interfaces of Mac OS X programs?

5

4

How can I edit the user interfaces of Mac OS X programs? I'd like to tweak settings for some programs, things like window sizes.

cwd

Posted 2011-06-26T20:04:25.703

Reputation: 13 508

Awesome question. Thank you very much. Having a go at the puke turquoise of Airfoil 5 right now. Whatever happened to tasteful grey and chrome? – Foliovision – 2018-04-10T23:29:19.150

This is on-topic because it's simple resource hacking and requires no programming skills, therefore isn't programming. We just want to tweak and fix third party applications we don't have the source code to. – Daniel Beck – 2011-06-26T20:17:19.493

Answers

13

Mac OS X applications that are created using Xcode had their GUI commonly designed using Interface Builder (now integrated in Xcode 4).

The GUI definitions are stored in files with the extension .nib and in the Contents/Resources directory of the finished application bundle. These files can be edited using Interface Builder as they're not compiled in the same way source code files are.


The following example edits the About window definition file of Reeder, a commercial RSS/ATOM reader.

It's Reeder.app/Contents/Resources/About.nib. If we open this file in Interface Builder, it will not display. For some time, .nib files are distributed in a "compiled" form, maybe because editing them was too widespread.

To be able to edit the .nib files, we need to "decompile" them using e.g. this program called NibDecompiler. Download and copy the NibDecompiler.workflow file to ~/Library/Services. Now there'll be a NibCompiler context menu entry on files which we can use to make the .nib files editable.

enter image description here

Create a copy of Reeder's Reeder.app/Contents/Resources/About.nib on your desktop, "decompile" it from its context menu, and open it in Interface Builder or Xcode 4.

enter image description here

Now you can edit, for example, the label containing the program name. Save, and replace the original file in Reeder's application bundle. Launch Reeder and see for yourself:

enter image description here

We can clearly see in the editor, that not everything is designed in Interface Builder. Some applications can create their whole UI in code, and don't need .nib files at all. Others create only the most elaborate parts of some windows in code. We can only edit using this approach what was designed in the .nib files.

That means, you can resize the windows defined in these files:

enter image description here

But if their contents are created programmatically, don't be disappointed in the devs didn't develop with your changes in mind and e.g. layout breaks.


Editing resources will break code-signing, which is used for the OS X Firewall and, AFAIK, Keychain authentication (to allow access after application updates automatically).

Since some applications load the .nib and then perform some additional changes (e.g. inserting the version number into the About dialog), you might actually break some functionality when you do this. You probably shouldn't do this at all, actually ;-)

Daniel Beck

Posted 2011-06-26T20:04:25.703

Reputation: 98 421

Unfortunately, the PandoraJam developers resize the window in code after it has been loaded, to editing its MainMenu.nib doesn't work. – Daniel Beck – 2011-06-26T20:09:30.747