以编程方式访问Apple Notes内容

rdk*_*dkn 3 macos ios

是否可以以编程方式访问Apple Notes(即macos和ios中预先安装的应用程序)内容

pet*_*eog 7

关于macOS的说明可以使用AppleScript编写脚本

要注销所有注释,请打开脚本编辑器并使用以下内容创建新脚本,然后点击播放按钮:

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
Run Code Online (Sandbox Code Playgroud)

或者,创建一个包含上述内容的文本文件并将其保存为notes.scpt,然后从终端运行:

osascript notes.scpt
Run Code Online (Sandbox Code Playgroud)