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 than extracting notes.
It seems rather simple. However when I get the presentationNotes its in an RichText object that doesn't seem to have anyway to get normal text. So I figured I'd open up textEditor and write them out to it. Well I can't figure out how to do that.
var app = Application('Keynote')
document = app.documents[0]
slide_name = document.name()
i = 1 // loop through folder contents
folder_name = 'chapter'+i
//create a 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 help would be appreciated. I've seen some applescript examples, however I couldn't get them to translate. Apparently applescript as text doesn't relate to toString()