Discover Office for Mac features using the defaults command

Discover features and change settings in Office for Mac Preview using the OS X 'defaults' command.

Discover Office for Mac Preview feature using defaults command

Office ribbon

I am not a fan of the Microsoft Office ribbon -- it makes menu items harder to find than the pull down menu used in older versions of MS Office. I also believe that the ribbon consumes far more screen "real estate" than it should, especially when compared to the small compact toolbars of old, feeling intrusive and "in my way."

That being said, the ribbon will most likely be around for a while and by the time I've grudgingly gotten used to it, Microsoft will have probably introduced its replacement. So given my love of the office ribbon, I couldn't help noticing that it recently made an appearance on my Mac, by way of Microsoft's Office for Mac Preview:

Office for Mac Preview toolbar

Disabled preferences

Using Word for Mac preview, I decided to see if the ribbon could be disabled or turned off, and opened Ribbon settings in the Preferences... menu. Although it appears that Microsoft may allow the ribbon to be turned off in a future version of Word, for now this feature is disabled in the preview version.

As shown in the image below, Turn on the ribbon option is checked --yet greyed out and disabled -- making it impossible for the user to change.

Office for Mac Preview ribbon preferences

With no way to change this behavior via Preferences, I decided to see if it this could be changed using Mac OS's defaults command.

Finding an app domain

Before an application default can be changed, its proper domain name needs known first. To find the domain name of an app, search for it in the Application Support database used by the system Dock. Using Terminal, type the following:

$ cd ~/Library/Application\ Support/Dock/
$ ls
Find the Application Support db used by Dock

The ls command lists all files in the folder, on my machine the database name was the long filename beginning with "31CA4444." In Terminal, the database can then be examined using the sqlite3 command:

$ sqlite3 31CA4444-A238-4F3E-B243-D5162F036254.db

Next, select all records from the apps table containing "icro": 

sqlite> select * from apps WHERE title like '%icro%';
Finding the app domain name of Word for Mac Preview

Based on these records, we can see that is the domain name used internally by the Dock for Microsoft Word. When finished with sqlite3, type .exit at the prompt to return to the bash shell.

Word for Mac Preview settings

I prefer piping or redirecting all of an application's defaults to a text file, this makes discovering and wading through settings keys easier to read, bookmark and highlight using a GUI editor.  

For example, I used the following bash command to dump Word for Mac Preview settings to a new file named mswdefaults.txt in my home folder.

$ defaults find > ~/mswdefaults.txt

I recommend using a "programmer friendly" text editor -- I prefer TextWrangler -- to view the file contents. I used TextWrangler's Find All search to generate a list of every line containing the word "ribbon" in the file. These are keys and values used by Mac OS X apps to read configuration settings, used in a similar way that Windows apps use the registry:

All lines containing the word 'ribbon'

Turning once again to Terminal, I changed the Disable Ribbon key value from false to true, verifying the change afterwards. Because the backslash (\) character is escaped, I replaced each instance of "\\" with a single "\" in the defaults write command:

$ defaults write "14\\Options\\Options:Disable Ribbon" -bool true 
$ defaults find "Disable Ribbon"
defaults bash commands

As it turns out, the Preview version of Word ignores this setting, probably because this feature isn't finished or supported yet. But changes to other keys are not ignored, such as kOUIRibbonDefaultCollapse, along with the scads of other settings and keys listed in the text file.

$ defaults write "kOUIRibbonDefaultCollapse" -bool true

Reasons to like the defaults command

For applications like Office for Mac Preview, using defaults can be a way to discover features that have a high likelihood of being introduced in future versions. For other applications, changing defaults is a nice way to change the behavior of an app so that it can be better suit user or business needs. Mac OS'x default commands can also be scripted by admins, providing an easy way to enforce the same application behavior across an enterprise.

This article is published as part of the IDG Contributor Network. Want to Join?

ITWorld DealPost: The best in tech deals and discounts.
Shop Tech Products at Amazon