首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >是否可以使用Applescript以固定顺序在Reminders.app中创建新项?

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

Stack Overflow用户
提问于 2012-11-12 18:39:48
回答 1查看 324关注 0票数 0

我希望能够在一个特定的顺序,使用AppleScript在提醒列表中添加项目。

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

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2012-11-13 02:34:19

在创建提醒之后添加一个小延迟似乎就解决了这个问题:

代码语言:javascript
复制
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
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13342231

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档