views:

707

answers:

1

I am no AppleScript Jedi, I've only done a few simple things, but I haven't been able to figure this one out and could use some help:

My wife uses slides for her Art History courses and would like to use the same slides for exams (sans identifying names). Rather than create a new presentation, I'd like a tool that iterates through the slides and hides the text fields.

Looking through the Keynote dictionary didn't give me any clues as to how to approach this, any ideas?

+1  A: 

AFAIK, with Applescript you can only access the title and the body boxes of the slides. If the text you wish to remove is consistently in either of these boxes the simplest solution would be to loop through the slides replacing that text and then saving a copy of the document.

tell application "Keynote"
    open "/Path/To/Document"

    repeat with currentSlide in slides of first slideshow
        set title of currentSlide to " "
        set body of currentSlide to " "
    end repeat

    save first slideshow in "/Path/To/Document without answers"
end tell

If the text is in a container created with the textbox tool, I don't think you can solve it with Applescript, but Keynote uses an XML based file format, so you could try doing it by editing the XML with your scripting language of choice. The XML schema is documented in the iWork Programming Guide.

Hagelin