Exporting Keynote text via Applescript?

Hi all,

Recently I was asked to extract the text in my Keynote presentation to a separate text file. I turned to Applescript, just as a little project - create a variable, append the text of each text box of each slide to it, write the resulting file to a text document. Simple.

I could get the text out of Title boxes, but I didn't know how to get the text out of other free text boxes on a slide (there is provision for the Notes field, but I couldn't see how to get the presentation text).

Is this possible? How is it done?

Hope you can help,

-Oro


iMac 800MHz Mac OS X (10.4.8)

Posted on Feb 14, 2007 4:20 PM

Reply
3 replies

Feb 15, 2007 4:02 AM in response to Oroboros

You're right that Keynote's dictionary is limited, and as far as I know there is no way to easily address individual text boxes. You might try taking a look at the underlying XML file -- you might be able to write a script that would parse that and grab all the text from it. Failing that, you should be able to write a script that automates the PDF export technique.

Feb 14, 2007 6:21 PM in response to Oroboros

There's a much faster way to do this - save the presentation as a PDF (do this from the Print dialogue, and in the "Copies and Pages" dropdown menu, select Keynote, and check "Don't print slide backgrounds"). If it is saved as a PDF, all of the text becomes selectable in Preview -- you can simply open the PDF, choose "Select All", and this will select all the text in the entire document. You can then just paste this into a new TextEdit document (or your favourite text editor) and there you have it. The text in the free text boxes may show up slightly out of order as the text is physically laid out on each slide, but this will be very quick.

Feb 14, 2007 10:08 PM in response to Tulse

Thanks Tulse, but I don't quite see how this is much faster 🙂

Obviously, I'll spend a little time programming an Applescript. But I'll be using this script over and over again as a mini-program: one double-click and my text is exported.

You've suggested a print command, a checkbox alteration, an export to a PDF, a copy command, and a paste into a new document.

Don't get me wrong, I see how your work-around can help, thanks 🙂 I'm looking for a more elegant solution, is all. Perhaps I can write a script that does all of your directions Tulse, but I suspect what's wrong is that Keynote's script dictionary is rather limited.

InDesign is a layout program I use a lot. The InDesign Applescript dictionary allows me to target frames of text - each textbox has an ID. However, it seems the only frame with an ID in Keynote is the 'Title' textbox. I hope I'm wrong, but this is all I see.

Does anyone have a way to target other Keynote textboxes on a slide?

-Oro

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Exporting Keynote text via Applescript?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.