update: They fixed the bug in 9.0.1, so we don't need this script any more, but I'll leave it as a starting point for how to crack open the contents of a Keynote document.
I dutifully upgraded to iWork '09 which contains an upgraded version of Keynote. Much to my dismay, there's a critical bug in this first release: when the outline mode left column is resized before saving the keynote document, upon restoration the left column is not resized properly, often hiding the scroll handle and scrollbars!

But, I recalled that a keynote document is nothing more than a zip archive around a bunch of files, one of which is a giant XML file containing most of the base content. After a half hour of experimenting, I figured out that the difference between a broken save and a good save was the presence of a single XML element. So I wrote a quick script to remove the XML element, and rebuild the zip archive:

#!/usr/bin/env perl use strict; $|++; use Cwd qw(abs_path); use File::Temp qw(tempdir); @ARGV = map abs_path($_), @ARGV or die "$0: please give keynote zip names on command line"; while (@ARGV) { my $key = shift; -e $key or die "$key not found"; my $tempdir = tempdir( CLEANUP => 1 ); chdir $tempdir or die "cannot cd $tempdir: $!"; system "unzip", $key; my $flag = 0; { local @ARGV = "index.apxl"; local $^I = "~"; while (<>) { s#(<key:BGShowUIStateOutlineWidth>.*?</key:BGShowUIStateOutlineW +idth>)## and $flag = 1 and warn "removed $1"; print; } } (warn "no changes made, skipping\n"), next unless $flag; my $old_key = $key; $old_key =~ s/\.key$/ OLD.key/ or $old_key .= "-OLD"; (warn "unsafe to mv $key $old_key, skipping\n"), next if -e $old_key +; rename $key, $old_key or die "cannot mv $key $old_key: $!"; system "zip", "-r", $key, '.'; }
Now, I can get on with my Keynote development, just remembering to run this script once to start a new editing session. I just pop open a local Terminal window, type "fix-keynote-outline" followed by a space, then drag the keynote file into the Terminal window, which automatically pastes the full unix path. I press return, and within a few seconds, a new keynote file appears with the outline mode restored.

In reply to Work around a bug in Apple Keynote '09 by merlyn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.