Apple Mail Error 471

A couple of weeks ago I finally got around to actually upgrading to Leopard on my laptop. One of the things I was interested in trying out once I got upgraded was Apple Mail’s new Note feature.

I fired up Mail and clicked on the note icon and…nothing happened. Hmmm, check the Menu bar. Go to File → New Note…nothing again. Well okay, I thought to myself, somethings wrong here. Maybe I should do a Google search. Hmmm, what to search. Mail Notes Error. Umm, okay too generic, I’ll try being more specific. Apple Mail error opening new note. Grrr. Try several other search strings. #@$%*! 1

Okay, so it’s become clear to me at this point that Googling the problem is just not going to work. I decide to fire up Console to see if there are any enlightening error codes. Console does at least offer me something, in the form of “Mail[471] font-family cannot be nil”.

Mail Error-font-family cannot be nil

Hmm, that looks like gibberish to me. I do some more unsuccessful Google searches. Finally, I decide to attempt to decode that error again. That error means that somewhere a font family is not selected or unavailable. We know it’s happening when a new note is being created. I opened up Mail again and started pursuing the preferences. Low and behold, under the tab for Fonts & Colors, I found this:

Mail Preference Pane for Fonts and Colors

The field for the Note font is completely blank. I selected a font and attempted to open a new note. Success!

As it turned out, this happened to be a very simple solution for a very silly problem. That solution took me over an hour to figure out. Unfortunately, I’ve never been able to figure out why that field was blank in the first place. I wonder how many other people have had this exact same problem and just given up on trying to figure it out.

  1. Side Rant: What exactly was Apple thinking when they named their email client “Mail.” Could they have thought of a worse name? It is impossible to search for information about a problem with the program because “mail” could refer to so many things. It’s kind of like buying a computer, that has the model name of “computer.” Then say said computer one day won’t start up. You find another computer and start doing a search for the problem. Your query string is going to look something like this: [brand name] computer won’t start. Completely useless.

Multi Safari

Apple has just released the 10.4.11 update for Mac OS X Tiger, which has two interesting tidbits. First of all, it lists “Improves compatibility when using OpenType fonts in QuarkExpress.” I would be really interested in knowing more about exactly what has changed here. Unfortunately, given how tight-lipped Apple usually is about these types of things, I doubt I’ll find out.

The second item pertains to Safari 3. Starting with this update, Safari 3 will be the default browser. Now, this is really great, but it introduces some problems with my workflow. If I install this update, how am I going to be able to continue to test my designs in Safari 2.x?

As it turns out, Michel Fortin has gone through the trouble of creating standalone versions of every Safari installment. So go ahead, jump on that update from Apple, then grab a standalone copy of Safari 2.

Helvetica Poster Contest

Linotype has posted all of the entries for their Helvetica NOW Poster Contest. There are some very neat posters shown. Remember to vote for your favorites.

No Time for Losers Helvetic November

New Font Features in Leopard

Typographi has a post on Grading the New Font “Features” in OS X Leopard. There is some good information on font improvements that I haven’t heard about elsewhere. The feature to print out Font Book pages sounds nice.

The feature that really got me excited1 though was this:

Automatically activate fonts as you need them. When an application requests an installed font that’s currently disabled, Leopard activates that font and keeps it active until the requesting application quits.

If this feature actually works and works well with lots of fonts, it’s easily got to be one of the killer features of Leopard. Seamless font auto-activation built into the os is worth the price of admission alone. How many other font management applications cost money and don’t really work (other than of course FontExplorer X, which is free)?

I’m not holding my breath though.

  1. By excited I mean pessimistically hopeful.

Using FontExplorer X With Networked Home Directories

FontExplorer X has some really funky behavior when it comes to users with networked home directories. Normally, the application files for FontExplorer are stored in ~/Library/Application Support/Linotype/FontExplorer X/. Everything works fine and dandy…until a user with a networked home directory tries to open in.

When a user with a networked home folder tries to open the FontExplorer X, the file ~/Library/Application Support/Linotype/FontExplorer X/FontDatabase.db is made into an alias. Note that this is a rather important file. It appears to store the references to all of your fonts (not the fonts themselves, just the references). The alias points to a newly created FontDatabase.db file in /Users/Shared/Linotype/FontExplorer X/_/, where is the username of the current user and is the user id of the current user.

The end result of this behavior, is that FontExplorer behaves as if it’s the first time FontExplorer X has been opened, every time someone uses it. Of course, in a lab type environment this behavior is completely unacceptable.

Below are login/logout scripts that I wrote to circumvent this behavior. You can download the scripts and a readme.txt file here:

Update: I should point out here that this particular script has only been tested on OS X 10.4 (Tiger). It will work on 10.3, but the way that you set up the login hook is slightly different than what I describe below. I’m also using FEX 1.2.2 for this script and it should be noted that the way FEX stores it’s database changed slightly in this version. Previous versions of FEX should work with this script using only a small tweaking. As I have not gotten my hands on a Leopard yet, I have no idea if this will work with them. (added 11/8/2007)

Update #2: This script is still working like a charm using OS X 10.5.4 and FEX 1.2.3. (added 8/12/2008)

Update #3: This script still works using OS X 10.6 and FEX 1.2.3. (added 2/7/2011)

The Setup

  1. Start by setting up FEX on a test computer. Set all the preferences as you want them and make sure the fonts are imported into appropriate sets.
  2. Font Library: Make a copy of your entire font library and note the location it’s stored in. I use /Users/Shared/Font Explorer X/ so that everybody has access to it.
  3. FEX plist: make a copy of the FEX plist file located in /Users//Library/Preferences/com.linotype.FontExploereX.plist
  4. Application Support Files: Make a copy of the Linotype application support folder located in /Users//Library/Application Support/
  5. A copy of each of these must reside on the client computer (the one your running the login script on).

* Make sure that the entire font library is in the same location on the client computer as it was in the test machine (/Users/Shared/ in my case). * Copy the FEX plist and Linotype folder to a privileged location on the client computer. It doesn’t matter where they are, we just don’t want normal users to be able to modify them. I use an admin’s document folder.’ 6. Change the $backupprefs and $backupdb variables in login.sh to the correct locations. They should be lines 11 and 14.

Installation

  1. Copy login.sh and logout.shto client computers. Make sure that you limit access to the files. They will be run as root, so these permissions will work:
     sudo chown root:admin <pathToFile>/login.sh <pathToFile>/logout.sh sudo chmod 750 <pathToFile>/login.sh <pathToFile>/logout.sh 
  2. Add the login and logout hooks. Run these two commands in the terminal of the client computer:
     sudo defaults write com.apple.loginwindow LoginHook <pathToFile>/login.sh sudo defaults write com.apple.loginwindow LogoutHook <pathToFile>/logout.sh 
    Note: This works on 10.4. The syntax for 10.3 might be slightly different
  3. To test to make sure the hooks got set up correctly, run this command and ensure that the directories are correct:
    sudo defaults read com.apple.loginwindow

Adding to Existing Login and Logout Hooks

If you already have login and logout scripts running, simply append the contents of these scripts to your existing ones. Everything should still work fine.

Login.sh

 #!/bin/sh ### Modify these ### # change to location where you put FEX plist file backupprefs="/Users/admin/Documents/com.linotype.FontExplorerX.plist" # change to location where you put Linotype file backupdb="/Users/admin/Documents/Linotype" ### Start of Script ### # Get the shortname of user who just logged in username=$1 # create hidden file containing username for the logout script echo $username > /Users/.username # get the user id of user who just logged in userid=`su - $username -c "/usr/bin/id -u"` # set a variable for the FontExplorer folder in the format of _ userfolder=${username}_${userid} # get the path to the networked home directory of user userhome=`su - $username -c "/usr/bin/id -P | cut -f9 -d:"` # Make the prefs directory in /Users/Shared/ for networked users mkdir -p "/Users/Shared/Linotype/FontExplorer X/$userfolder/" # On the rare occassion that the logout script fails to copy the FontDatabase.db file back to user's folder, # this will copy in a default backup copy of the FontDatabase.db file if [ ! -e "$userhome/Library/Application Support/Linotype/FontExplorer X/FontDatabase.db" ]; then cp -R $backupdb "$userhome/Library/Application Support/" chown -R $username:$username "$userhome/Library/Application Support/Linotype/" fi # Copy the real FontDatabase.db file from user's home to the /Users/Shared location cp "$userhome/Library/Application Support/Linotype/FontExplorer X/FontDatabase.db" "/Users/Shared/Linotype/FontExplorer X/$userfolder/" # Set the ownership and permissions on the /Users/Shared/Linotype/ directory chown -R $username:$username /Users/Shared/Linotype/ chmod -R 700 /Users/Shared/Linotype/ # Copy correct user preferences (users can't break them) # Don't need to do this step, but helpful in making sure correct prefs are always set cp $backupprefs "$userhome/Library/Preferences/com.linotype.FontExplorerX.plist" chown $username:$username "$userhome/Library/Preferences/com.linotype.FontExplorerX.plist" chmod 700 "$userhome/Library/Preferences/com.linotype.FontExplorerX.plist" 

Logout

 #!/bin/sh # Get username of current user username=`cat /Users/.username` ### Start of Script ### # get the user id of current user userid=`su - $username -c "/usr/bin/id -u"` # set a variable for the FontExplorer folder in the format of _ userfolder=${username}_${userid} # get the path to the networked home directory of user userhome=`su - $username -c "/usr/bin/id -P | cut -f9 -d:"` # Remove the sym link version of FontDatabase.db in user's home rm "$userhome/Library/Application Support/Linotype/FontExplorer X/FontDatabase.db" # Copy version of FontDatabase.db from /Users/Shared/ back to user's home cp "/Users/Shared/Linotype/FontExplorer X/$userfolder/FontDatabase.db" "$userhome/Library/Application Support/Linotype/FontExplorer X/FontDatabase.db" # Make sure ownership is correct chown -R $username:$username "$userhome/Library/Application Support/Linotype/" # Remove all of the user's Linotype directories from the /Users/Shared/ directory rm -R /Users/Shared/Linotype 

Cheers.



appointive
appointive
appointive
appointive