Skip to content Skip to sidebar Skip to footer

Extract Presentationnotes From Keynote

I'm having a hard time extracting presentationNotes from a keynote presentation using JXA (Javascript for osx) I don't want to use applescript. There is way more to this script tha

Solution 1:

You were almost there. You should not push the text, but push a paragraph object of the text.

Here is a complete example (text only). It uses the currently open Keynote and TextEdit documents.

varKeynote = Application("Keynote");
var presentation = Keynote.documents[0];

varTextEdit = Application("TextEdit");
vardocument = TextEdit.documents[0];

document.paragraphs.push( TextEdit.Paragraph({color:"red", size:18}, "presentation: "+ presentation.name()+"\n" ))

for (var i=0; i<presentation.slides.length; i++) {
    slide = presentation.slides[i];
    slideTitle = slide.defaultTitleItem().objectText();
    notes = slide.presenterNotes(); // text onlydocument.paragraphs.push( TextEdit.Paragraph({color:"blue", size:14}, "\n"+ (i+1) +": "+ slideTitle + "\n") )   
    document.paragraphs.push( TextEdit.Paragraph({}, notes +"\n") ) 
}

Post a Comment for "Extract Presentationnotes From Keynote"