Daily Script: When does it run?

I’d like to run a script daily as early as possible (Actually when I wake up my laptop). The daily script runs daily, but I don’t know when exactly. How do I implemented the use case “run script once a day as early as possible”? Thanks in advance for tips.

I have only one script like that. Scheduled for 00:01 “daily” on a machine that sometimes goes to sleep over night. I notice the script runs what looks to be when the machine wakes up for some reason other than to run this script. For me that’s good as I don’t care if it does not run “on time” and have to wake up for it. It’s also good that eventually it runs and it seems to run only once.

Recommend you try and see if you see same.

I do prefer that my machine stays sleeping all night every night, but things seem to happen to come out of sleep. Trying to turn all those things off, but like swatting flies.

We are talking about a DEVONthink script here, right?

When you create a Smart Rule that runs a script and set it to “daily” the time of the day you saved the smart rule will be the time of the day it will run daily.

So you could either save the Smart Rule at midnight (or whatever time you prefer) … or you could set up a Reminder with the exact time you want and let the Reminder run the script.

But to do so DEVONthink itself will have to be running. If it is not it will run the script as soon as it is started again.

Actually, I would suggest using a Reminder. You can set a granular time and schedule and also execute an alarm script.

You can easily set the reminder on any item in the database, though the Inbox is the likely choice as it’s ever-present.

If I have a reminder on an item set to run every day at 11:30 AM, but some days the machine is shut down at that time, when will the reminder run the next time? I assume it runs the next time when the machine is running and DEVONthink 3 is running and it is 11:30 AM. E.g., if I boot the machine today at 2:00 PM the reminder is not going to run until tomorrow.

No, DEVONthink won’t skip a Reminder script. If DEVONthink hasn’t been running at the Reminder time it will run the Reminder script belated, as soon as it gets started.

I have set Reminders to backup databases as zip files every Sunday at 6 am but at that time I am very rarely awake and I always shut down my Mac before going to sleep. When I start my Mac and then DEVONthink the zipping scripts starts immediately.

Thanks. But actually I’d like to achieve the following which is something I guess is not possible with reminders:

  • Import calendar events into DEVONthink (done)
  • Set a custom meta data field with the event time (done)
  • Flag the note on the morning of the day of the event in the custom metadata field (not done)

The third step is what I wanted to do with a daily smart rule (screenshot)

So with a reminder I would need to be able to set it via Applescript and then have an action to flag an item when the reminder runs. Or are there easier ways to get this done?