Alternatives for achieving transclusion within DT3 (wiki post)

The script depends on the selection and on windows but the selection is not identical to the theRecords parameter (and smart rule scripts should never depend on the user interface). You can test smart rule scripts like this in the AppleScript editor:

tell application id "DNtp" to my onPerformSmartRule(selection as list)

on performSmartRule(theRecords)
	...
end performSmartRule
2 Likes

Does this assume something preceding the tell application id "DNtp" to my onPerformSmartRule(selection as list) part? Maybe I am being stupid and doing something wrong, but as it is I could not get it to work at all.

No. It should work like this in the Script Editor.app but not in a smart rule.

This is what I am seeing:

Weird. This seems to be another issue of AppleScript and I could swear that I used this already several times but maybe I’m getting old or it worked before Catalina :wink: A test database plus the children of its root should work instead (using test data while developing smart rules is also a good idea)

Your handler name is incorrect.

It’s my performSmartRule() not my onPerformSmartRule.

My fault :frowning:

Aha!

Thanks, Jim :wink:

You’re welcome :slight_smile: