bjw
bjw

Reputation: 2017

How can I access the text of notes in a ppt file via applescript?

I'd like to get the text of notes in a PPT file on os x. I feel like this should work:

get content of notes page of slide N of active presentation

But it always returns a "missing value". Any thoughts?

Incidentally, my goal is to be able to create a new version of a set of slides where the notes don't contain the text STUDENT=HIDE... I like providing slides to students, but don't always want them to see everything in advance (e.g. the correct result of an in-class exercise).

Upvotes: 1

Views: 1372

Answers (1)

jackjr300
jackjr300

Reputation: 7191

The notes are in the shapes (place holder class --> text frame --> text range --> content).

Here is an example of how to get value of the note in each slide :

tell application "Microsoft PowerPoint"
    repeat with tSlide in (get slides of active presentation)
        set tNote to ""
        repeat with t_shape in (get shapes of notes page of tSlide)
            tell t_shape to if has text frame then tell its text frame to if has text then
                set tNote to content of its text range -- get the note of this slide
                exit repeat
            end if
        end repeat
        if tNote does not contain "STUDENT=HIDE" then
            --- *** do something with tSlide *** ---
            --
            --
        end if
    end repeat
end tell

Upvotes: 6

Related Questions