【发布时间】:2015-07-06 15:34:15
【问题描述】:
我很难使用 JXA(用于 osx 的 Javascript)从主题演讲中提取presentationNotes 我不想使用applescript。除了提取笔记之外,此脚本还有更多功能。
看起来很简单。但是,当我在一个 RichText 对象中获取presentationNotes 时,它似乎无论如何都无法获取普通文本。 所以我想我会打开 textEditor 并将它们写出来。 好吧,我不知道该怎么做。
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.
}
任何想法或帮助将不胜感激。我看过一些 applescript 示例,但是我无法翻译它们。显然作为文本的 applescript 与 toString() 无关
【问题讨论】:
标签: javascript applescript osx-yosemite automator javascript-automation