reminders-cli
reminders-cli copied to clipboard
Times out
On a couple of computers, one El Capitan, one Sierra, I get an AppleScript timeout on both.
script:64:109: execution error: Reminders got an error: AppleEvent timed out. (-1712)
Is there a way to fix this or extend the timeout?
@wongjustin99: can you tell me which command timed out? every command on applescript has a maximum execution time of 2 minutes, it's weird that the cli is exceeding it.
I was trying reminders --list.
Here's a fuller stack trace:
➜ reminders-cli git:(master) ✗ reminders --list
⠸ Loading reminders^CError: /usr/local/lib/node_modules/reminders-cli/dist/commands/../scripts/get_reminders.applescript:64:109: execution error: Reminders got an error: AppleEvent timed out. (-1712)
at ChildProcess.<anonymous> (/usr/local/lib/node_modules/reminders-cli/node_modules/applescript/lib/applescript.js:49:13)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
I just ran the dev version and added a 1-hour timeout instead and that got it to work. I think something about your get_reminders.applescript is timing out with a lot of reminders.
@wongjustin99: hmm, how many reminders do you have? Did you see how long it takes to list all of them after you updating the timeout?
Counting completed? Spread around 10 or so lists, 1000-1300. Not completed? Less than 100.
Yeah, it took around 15 minutes, and it locked up the native Reminders application as well. I think that loop may not be the most efficient.
Here's how I added that timeout:
with timeout of (30 * 60) seconds
tell application "Reminders"
set reminderList to {}
if (count of (reminders whose completed is false)) > 0 then
set reminderList to name of reminders whose completed is false
end if
quit
return reminderList
end tell
end timeout
On 25 October 2017 at 02:57, Lucas Bento [email protected] wrote:
@wongjustin99 https://github.com/wongjustin99: hmm, how many reminders do you have? Did you see how long it takes to list all of them after you updating the timeout?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/lucasbento/reminders-cli/issues/2#issuecomment-339233224, or mute the thread https://github.com/notifications/unsubscribe-auth/ABgsDjQKF8JpTnJUTRtE9sjf-uJW5qxiks5svtvQgaJpZM4QDO5D .
Yeah, gotta improve the loop perf, I'll try to have a look on it once I have some free time.
Thank you for reporting it, @wongjustin99!