以编程方式访问Apple Notes内容 [英] Programmatically access Apple Notes contents

查看:44
本文介绍了以编程方式访问Apple Notes内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Is it possible to programmatically access Apple Notes (that is the preinstalled app in macos and ios) contents

推荐答案

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

Notes on macOS is scriptable with AppleScript

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

To log out all the notes, open Script Editor and create a new script with the following, then hit the play button:

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,然后从终端运行:

Alternatively, create a text file with the contents above and save it as notes.scpt, then from Terminal run:

osascript notes.scpt

这篇关于以编程方式访问Apple Notes内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆