Numbers 1.0: Saving as PDF with extension visible creates double extension

Posted by Pierre Igot in: Macintosh, Pages
October 16th, 2007 • 3:52 pm

I always use Mac OS X with all file extensions visible.

This means that the option to “Show all file extensions” is checked in my Finder preferences (under “Advanced”)—although this is clearly not sufficient as I also regularly have to uncheck the “Hide Extension” check box in the “Save As…” dialog box in the various Mac OS X applications that I use, including Pages, TextEdit, etc., because the file extension behaviour in these “Save As…” dialog boxes is obviously unrelated to the Finder preference setting and is an application-specific thing.

(It still seems to me that Apple could fairly easily make the status of the “Hide Extension” check box in a given application’s “Save As…” dialog box match the setting in the Finder preferences by default. If “Show all file extensions” is checked in the Finder, than the “Hide Extension” check box could be unchecked by default. Unfortunately, it is usually checked by default, regardless of the Finder preference.)

Why do I have the file extensions visible at all times? Because I want to be in control, and because Mac OS X’s behaviours when it comes to hiding file extensions are neither smart nor elegant anyway. Of course, it’s still sad that we have deal with file extensions at all in the first place, but there’s not much point in complaining about that anymore…

Anyway, the problem in Numbers is with what happens with file extensions when you try to save a Numbers document as a PDF file. There are two ways to do this: You can either use the “Export…” command and choose the “PDF” option or you can use the standard “Save as PDF” button in the dialog box for printing.

If you use the “Export…” command, Numbers does the correct thing regardless of whether the file extension is visible in the “Save As…” dialog box or not. If your Numbers document is called “test.numbers,” then when you export it as a PDF file the resulting document is correctly named “test.pdf.”

When you use the standard “Save as PDF” button in the dialog box for printing to save the document as a PDF, on the other hand, the behaviour depends on whether the file extension is visible or not. If the file extension is not visible, then Numbers does the correct thing and saves the PDF file with the name “test.pdf.”

If the file extension is visible, however, then Numbers add the “.pdf” file extension to the full name of the file, including the “.numbers” file extension. So you end up with a PDF file named “test.numbers.pdf.”

It is not a huge problem in itself, since Mac OS X actually tolerates double extensions and just uses the last extension as the extension that defines the file type. So the resulting file does behave as a normal PDF file.

The problem here is simply that this is not consistent either with the other way of creating PDF files from within Numbers (i.e. the “Export…” command) or with what happens in other Apple applications, such as Pages. In Pages, if you use “Save as PDF” button in the dialog box for printing to save the document as a PDF, then Pages removes the “.pages” extension and uses “.pdf” instead.

I guess it’s the kind of fairly innocuous bug that one can expect to find in version 1.0 of a new product… except that both Keynote and TextEdit suffer from the same problem.


3 Responses to “Numbers 1.0: Saving as PDF with extension visible creates double extension”

  1. ssp says:

    Just off the top of my head: Try using this command to set a reasonable default for ‘extension hiding’ in Save dialogues:

    defaults write NSGlobalDomain NSNavLastUserSetHideExtensionButtonState -bool NO

  2. Pierre Igot says:

    Good one. It seems to work (i.e. I quit TextEdit, trashed its prefs, launched it to confirm that by default the extension would be hidden, then quit it again, trashed the new prefs just created, then applied the recommended command-line command, then launched TextEdit again, and indeed by default the file extension was visible).

    Is there another one like this to force all Save As dialog to have the file location browser visible in full by default?

    Are all these inaccessible prefs documented somewhere?

  3. ssp says:

    NSNavPanelExpandedStateForSaveMode should be the magic for that one.

    I don’t know about a list of those settings, but doing all the settings you want in an application and then reading its preference file should reveal them to you. Setting them globally afterwards should give you the default you want.

    I think I may just write this up in a blog post, as it could be quite handy and the defaults system is one of the nicer parts of OSX.

Leave a Reply

Comments are closed.