0

我希望能够使用 AppleScript 以特定顺序将项目添加到提醒列表中。

但是,使用以下脚本,每次运行时都会以不同的顺序添加项目:

set my_reminders to {"item4", "item3", "item2", "item1", "item"}
tell application "Reminders"
    tell list "Reminders"
        repeat with the_name in my_reminders
            set this_reminder to make new reminder with properties {name:the_name as string}
        end repeat
    end tell
end tell
4

1 回答 1

1

似乎在创建提醒后添加一个短暂的延迟可以解决问题:

set my_reminders to {"item4", "item", "item2", "item1", "item3"}
tell application "Reminders"
    tell list "Reminders"
        repeat with the_name in my_reminders
            set this_reminder to make new reminder with properties {name:the_name as string}
            delay 1
        end repeat
    end tell
end tell
于 2012-11-12T18:34:19.333 回答