Can this cause a smart rule loop?

In DEVONthink 3.8, suppose I have a smart rule that triggers “on import”. If this rule executes the following script,

on performSmartRule(selected_records)
	tell application id "DNtp"
		repeat with _record in selected_records
			perform smart rule trigger import event record _record
		end repeat
	end tell
end performSmartRule

Will this cause the current smart rule to also be run again, leading to a loop?

Actually this command is only intended for stand-alone scripts (e.g. folder actions, Mail rules or Scripts menu), not for smart rule scripts. Why don’t you use the Apply Rule action introduced by version 3.8?

Thank you for your ultra-fast reply. So, just to be clear, using that bit of applescript will cause a loop, then?

Using Apply Rule happens to be difficult for my case because I had to write about 20 rules to implement something else, and thus I’d have to have an Apply Rule for each one of those other rules. It can be done, but if I change those rules, I’ll forget to update this one, so I’m hoping for a one-shot approach.

Basically, I’m trying to find a way to do the equivalent of “run all the other on-import rules again after running this rule”.

Actually it should be ignored/blocked. If that’s not yet the case, then the next release will do this.

What about scheduling the rules?

1 Like

Okay, I think that’s not happening. I, um, accidentally demonstrated the problem :-).

That is an excellent suggestion, which I will now test!

You’re right, fixed in the next release.

1 Like