Error "on performSmartRule (Error: Error: AppleEvent timed out.)" when running a smart rule wit a javascript script every minute

I tried to re-create your setup: A smart rule (in my case, selecting all documents in the Inbox) that is run every minute. The only action is an JavaScript. I do not see any error messages re time out.


I’m also unable to reproduce any timeout here either.
Select, Control-click, and disable the actions of other smart rules.
Do you see the timeout again?

The only reason I’m using the once a minute trigger, is that there is no trigger for custom meta data.

That is very strange. Currently I cannot reproduce it either, although I haven’t changed anything (except deleting some documents).

I will continue to monitor it. Thank you for your help.

1 Like

Why not Hourly or Daily to minimize the load?

@Lynx have you seen this behavior lately? I’m thinking I’m experiencing the same problem and wondering if you’re still having this issue: Timeout with performSmartRule

@mdbraber I’m still facing this issue. I thought it was a problem due to my local system, because no one could reproduce it. My workaround was setting the trigger of the rule to After Synchronization .

Is the smart rule only triggered every minute or also used by e.g. other smart rules and/or scripts? Does the rule maybe process huge documents and/or are the databases/documents located on a slow network volume?

It is only triggered every minute and not used in other smart rules.

No, it only process one document.

And there is no timeout, when I switch the smart rule to perform After Synchronization .

Does it work after disabling the actions of all other smart rules temporarily (e.g. via the contextual menu of the sidebar)? In addition, please choose Help > Report Bug while pressing the Alt modifier key and send the result to cgrunenberg - at - devon-technologies.com so that we can have a look at the logs - thanks!

No

Done.

Here is the smart rule:

and the script:

'use strict';

function performsmartrule(records) {
  const app = Application("DEVONthink 3");
  app.includeStandardAdditions = true;

  /* Loop over the records selected by the smart rule */
  records.forEach(r => {
    console.log("processed");
    // renameDocument(r)
    // moveDocument(r)
  })


}

Thank you.

Thank you for the logs! Unfortunately no hints, only a confirmation of the timeouts. And it’s working fine over here using the same macOS version.

Could this not be the same bug as the one you’ve identified (one script waiting for another)?

It’s AFAIK just one script and not called by any other scripts (or rules).

I’m seeing the same problem as @Lynx with a timeout

1 Like

@mdbraber At least you could reproduce it. Are you running it on an Intel Mac?

No, M1

Does it time out when targeting a much more specific location, e.g., a single database or group in a database?

In my case: I’m targeting a single group (Inbox) in a specific database (Resources)

Just curious: Does it time out with any other command than console.log ?