You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过AppleScript在macOS备忘录中创建真正的复选清单笔记?

在macOS备忘录中用AppleScript创建真正的复选清单笔记

你之前的脚本只显示纯文本,是因为备忘录的复选清单依赖富文本HTML格式,直接写入- [ ]这类纯文本不会被识别为可交互的复选框。要生成真正的复选清单,需要用备忘录支持的HTML结构来设置笔记内容:

tell application "Notes"
    activate
    set newNote to make new note
    set name of newNote to "Checklist test"
    tell newNote
        -- 使用备忘录兼容的HTML结构构建复选清单
        set body to "<ul class=\"checklist\">
    <li class=\"checklist-item\"><input type=\"checkbox\" class=\"checkbox\"> Checklist item 1</li>
    <li class=\"checklist-item\"><input type=\"checkbox\" class=\"checkbox\"> Checklist item 2</li>
    <li class=\"checklist-item\"><input type=\"checkbox\" class=\"checkbox\"> Checklist item 3</li>
</ul>"
    end tell
end tell

额外说明:

  • 如果需要创建已完成的复选项,只需给<input>标签添加checked属性:
    <li class=\"checklist-item\"><input type=\"checkbox\" class=\"checkbox\" checked> Completed item</li>
    
  • 备忘录会自动识别这种HTML结构,渲染出和手动创建一致的原生可点击复选框。

内容的提问来源于stack exchange,提问作者dj.dule

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 09:58:14