使用AppleScript更新Notes应用程序中的备注

使用AppleScript更新Notes应用程序中的备注,applescript,Applescript,我尝试了这段代码,但它删除了注释的标题!如何留下便条的标题 tell application "Notes" tell account "iCloud" tell folder "Category" set body of note "Test Post" to "reset the body text" end tell end tell end tell 注释的名称/标题通常是注释的第一行 获取便笺的名称,临时保存,设

我尝试了这段代码,但它删除了注释的标题!如何留下便条的标题

tell application "Notes"
    tell account "iCloud"
        tell folder "Category"
            set body of note "Test Post" to "reset the body text"
        end tell
    end tell
end tell

注释的名称/标题通常是注释的第一行

获取便笺的名称,临时保存,设置正文并重新指定名称

tell application "Notes"
    tell account "iCloud"
        tell folder "Category"
            tell note "Test Post"
                set tempName to its name
                set body to "reset the body text"
                set its name to tempName
            end tell
        end tell
    end tell
end tell

我忘了告诉文件夹行。请查看更新。接收标题为“测试帖子”的便笺时出错!当然,在这个帐户的文件夹中必须有一张有这个名字的便条。是的,她是!设置正文后,便笺的名称正在更改!设置旧名称不再获得!我经常写信。注释的主体实际上是HTML文本,因此仅更新名称可能不够。