是否有可能以编程方式访问苹果笔记(即macOS和iOS中预装的应用程序)的内容?
macOS可以使用AppleScript进行脚本编写。
要记录所有笔记,请打开“Script Editor”并创建一个新脚本,然后按以下步骤操作:
点击运行按钮。
tell application "Notes"
repeat with theNote in notes
set theNoteName to name of theNote
log theNoteName
set theNoteBody to body of theNote
log theNoteBody
log "----"
end repeat
end tell
或者,创建一个文本文件,内容如上所示,并将其保存为notes.scpt
,然后从终端运行:
osascript notes.scpt
}
}` - ovatsug25var app = Application("Notes"); app.notes().forEach(note => { console.log(note.name()); });
向https://github.com/abruneau/apple-notes-jxa/blob/master/lib/note.js致敬,感谢他们提供的解决方案。 - Aleksei