【问题标题】:AppleScript "Can’t get every note of account"AppleScript“无法获取所有帐户注释”
【发布时间】:2017-05-19 03:02:03
【问题描述】:

我今天是第一次试用 AppleScript。

想先在我的 Notes.app 中记录每条笔记的名称

这是我的脚本:

tell application "Notes"
    activate
    set mainAccount to the name of account 1
    tell account mainAccount
        repeat with n in notes
            log name of n as string
        end repeat
    end tell
end tell

我收到一条错误消息:

tell application "Notes"
    activate
    get name of account 1
        --> "iCloud"
    exists folder "Archive" of account "iCloud"
        --> true
    count every note of account "iCloud"
        --> error number -1728 from every note of account "iCloud"
Result:
error "Notes got an error: Can’t get every note of account \"iCloud\"." number -1728 from every note of account "iCloud"

这里发生了什么?

【问题讨论】:

    标签: automation applescript ui-automation


    【解决方案1】:

    帐户没有备注,只有文件夹。

    所以脚本可以这样写:

    tell application "Notes"
        activate
        set mainAccount to the name of account 1
        tell account mainAccount
            repeat with f in folders
                repeat with n in notes of f
                    log name of n as string
                end repeat
            end repeat
        end tell
    end tell
    

    【讨论】:

      猜你喜欢
      • 2018-01-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多