AppleScript errors in smart rules — no error messages?

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 :grin:

image

In the bug reporting, the Console.log should show AppleScript errors related to smart rules…

PS: the colours in the editor could definitely use a few tweaks for dark mode

Just stop using dark mode. It’s better for your health and success… and freshens your breath! :stuck_out_tongue:

1 Like

The next release will improve this.

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?)

You need to specify

  • the type
  • the destination group (Script Debugger says it’s optional, without it DEVONthink “Uses incoming group or group selector if not specified.”)

Try this

create record with {name:"TEST", plain text:theFormattedText, type:text} in incoming group
1 Like

Thanks — type is what was missing :slight_smile: