You’re welcome!
First, I would suggest running the scipt without the smart rule function first.
Work it out in Script Editor then add it as a smart rule when it’s working as expected.
Try this…
var app = Application("DEVONthink 3");
app.includeStandardAdditions = true;
records = app.selectedRecords();
records.forEach (r => {
n = app.getCustomMetaData({for:"decimal", from:r});
app.displayDialog(n);
}
)