How to speed up scripting Apple's Reminders app
How to speed up scripting Apple's Reminders app
- Subject: How to speed up scripting Apple's Reminders app
- From: Christian Boyce <email@hidden>
- Date: Wed, 09 Mar 2016 11:10:25 -0800
- Sendlaterdate: Wed, 9 Mar 2016 11:10:25 -0800
Howdy— I have this script:
tell application "Reminders" set the_list to first list whose name is "Blog Post Checklist" set the_reminders to every reminder of the_list whose completed is true repeat with a_reminder in the_reminders set completed of a_reminder to false end repeat end tell
This is working on a checklist that I re-use every time I write a new blog post. I have about twenty things to do when I write a post (set categories, share on Facebook, provide a featured image, etc.) so I want to start with all items unchecked. This script goes through the list and unchecks everything that is checked, but it takes a long time. More than a minute, when I have 20 items checked.
I am pretty sure my problems are in the "repeat" part. Up to the repeat it's super-fast.
Somehow I think there is a way to use "a reference" but when I do this:
set the_reminders to a reference to (every reminder of the_list whose completed is true)
… the script give me errors saying "Reminders got an error: Can’t get item 3 of every reminder of list id "68492545-59D3-485E-B7F4-F9654E53D2DA" whose completed = true. Invalid index"
I think what is happening there is the list of items whose completed is true changes as I uncheck things, so the reference is pointing to things that aren't there after I uncheck something. It seems pretty fast with the "reference" idea but the script doesn't work.
Any ideas for speeding this up? Mac OS 10.11.2.
Thank you—
c --Visit my website and blog:
Christian Boyce Christian Boyce and Associates Mac, iPhone, and iPad Consultants
For appointments, please call the office: 424-354-3548. We do not make appointments by email or text.
Current weather in Santa Monica, CA: Fair, 66° F
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden