When there is a runtime error in an AppleScript embedded in a smart rule, it seems to fail silently. I would have thought they’d appear in the log, but they don’t. Could somebody tell me where to find them, please?
My experiments have led me to this so far, but the record is not created:
on performSmartRule(theRecords)
tell application id "DNtp"
repeat with theRecord in theRecords
set theText to plain text of theRecord
set theFormattedText to "Record Creation Test" & linefeed & theText
create record with {name:"TEST", plain text:theFormattedText}
end repeat
end tell
end performSmartRule
It would be useful to see what I’m doing wrong…
PS: the colours in the editor could definitely use a few tweaks for dark mode
In the bug reporting, the Console.log should show AppleScript errors related to smart rules…
Thanks — I’m not seeing anything come up, but it’s difficult to find among all the noise from diskarbitrationd and locationd, to name but two. Filtering on devon doesn’t seem to find things — the errors show as being from DEVONthink, yes?
(As an aside, is create record with {name:"TEST", plain text:theFormattedText} the right way to create a plain text document in the Inbox?)