Script: Comfortably developing a Smart Rule Script

I wish I had reviewed the instructions for Scenario 2 before debugging a Smart Rule-based script over the weekend! I saw DEVONthink’s lovely “Welcome to DEVONthink 3” startup window far too many times…

In case it helps others, I built out a little script to create test files in order to test my Smart Rule-based script.

  1. Modify the below script such that the created file’s properties will cause your script to trigger.
  2. Insert the name of your Smart Rule in line ten, in place of “YOUR SMART RULE NAME” (perform smart rule "YOUR SMART RULE NAME")
my createDemoFiles()

on createDemoFiles()
	tell application id "DNtp"
		set theDestination to get record with uuid "9C204305-52CB-43DB-BC0C-44361880B8B4"
		set dateString to (current date) as text
		set theRecord to create PDF document from "https://fulcra.design/files/_Kudoz-Where-are-you-scaling-placemat.pdf" in theDestination name dateString
		set tags of theRecord to theRecord's tags & ".to-organize" & "News"
		delay 1
		perform smart rule "YOUR SMART RULE NAME"
	end tell
end createDemoFiles