Reminders.app中的新项目是否可以使用Applescript以固定顺序创建?

时间:2012-11-12 10:39:48

标签: applescript reminders

我希望能够使用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

1 个答案:

答案 0 :(得分: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