i'm having hard time extracting presentationnotes keynote presentation using jxa (javascript osx) don't want use applescript. there way more script extracting notes.
it seems rather simple. when presentationnotes in richtext object doesn't seem have anyway normal text. figured i'd open texteditor , write them out it. can't figure out how that.
var app = application('keynote') document = app.documents[0] slide_name = document.name() = 1 // loop through folder contents folder_name = 'chapter'+i //create folder var textedit = application('textedit') textedit.activate() var doc = textedit.make({new:'document'}) doc.text = "fsdfsdfs" var c = 0; for(slide in document.slides){ var s = document.slides[slide] var note = s.presentationnotes // returns object specifier //textedit.documents[0].push(note) // i've tried lots of things here. }
any ideas or appreciated. i've seen applescript examples, couldn't them translate. apparently applescript text doesn't relate tostring()
you there. should not push text, push paragraph object of text.
here complete example (text only). uses open keynote , textedit documents.
var keynote = application("keynote"); var presentation = keynote.documents[0]; var textedit = application("textedit"); var document = textedit.documents[0]; document.paragraphs.push( textedit.paragraph({color:"red", size:18}, "presentation: "+ presentation.name()+"\n" )) (var i=0; i<presentation.slides.length; i++) { slide = presentation.slides[i]; slidetitle = slide.defaulttitleitem().objecttext(); notes = slide.presenternotes(); // text document.paragraphs.push( textedit.paragraph({color:"blue", size:14}, "\n"+ (i+1) +": "+ slidetitle + "\n") ) document.paragraphs.push( textedit.paragraph({}, notes +"\n") ) }