Smart Rule Scheduling

Are there any tricks for scheduling smart rule executions other than every minute, hourly, daily or weekly ?

For example I’d like a smart rule to run every workday at 8am and midday.

As I’m running an AppleScript from the rule I appreciate I could have the smart rule run every minute and have my AppleScript determine the current time and just terminate if it wasn’t 8am or midday. But I was wondering if there was a better way to do this.

At the moment I’m scheduling the jobs from launchd but I’d prefer to run them from within Devonthink if possible. That way they only execute if Devonthink is running. Launching them from launchd results in Devonthink starting if it wasn’t running which isn’t always desirable.

Thanks

MS

If you’re only running the script, you could use a cron job for that. Running a script every minute as you describe is a complete waste of resources. If you want it to “really” execute only a 8am and noon, once every hour would be sufficient. Still a waste of resources, though,.

Ah. That’s the way to go for what you want. To prevent DT from starting up, you could simply check if it’s running first (assuming you’re using a shell script – you could also do a check in AS, I think):

ps u | grep DEVON 1&>/dev/null
if [[ $? != 0 ]]
  # DT is running
fi

You could use a daily reminder which executes a script. And this script performs the desired smart rule(s) via the perform smart rule command.

1 Like