Did you read the Automation > Smart Rule Scripts section or looked at other smart rule script examples?
-
The parameter for your handler is wrong. It should be a variable, e.g.,
theRecords
. -
You shouldn’t be processing the
selection
. The smart rule isn’t handling a selection. Strip out theif…then
regarding the selection. -
It’s handling matched items not a selection, so the
repeat
loop should be referencingtheRecords
or whatever the handler parameter’s variable is.