Subsequent Smart Rules with trigger "After Synchronization" aren't triggered

I’ve used two Smart Rules that process records (added via DTTG) from the global inbox (renamed it to “Admin”) for quite some time and they (almost) always worked.

Now it seems only the first one is triggered. Not sure when this started but I think it was after 3.8.

I first suspected it could be a problem with the Smart Rule that uses an AppleScript (although this should still be fine), so I tested the Smart Rules in reverse order. After that I added a third one that simply should add a label.

No matter what order I tried, there’s always only the first Rule triggered. Restarted DEVONthink , but it didn’t make a difference.


2 - is not triggered

3 - is not triggered

It would be useful to know what your external script is doing or to export, ZIP, and upload the smart rules for testing.

1 Like
Smart Rule script
-- Smart Rule - Verschieben in Datenbank Twitter

property theDatabasePath : "/Users/USER/Documents/DEVONthink/DEVONthink Datenbanken/Datenbanken/c. Twitter.dtBase2"
property theDatabaseName : "c. Twitter"

on run
	tell application id "DNtp" to my performSmartRule(selection as list)
end run

on performSmartRule(theRecords)
	tell application id "DNtp"
			set theOpenDatabaseNames to name of databases
			if theOpenDatabaseNames contains theDatabaseName then
				set closeDatabase to false
				set closeDatabase to true
			end if
			set theGroup to (get record with uuid "26FCABAA-0EFE-471B-BD19-2D5493D4A305") -- /Eingang [c. Twitter]
			repeat with thisRecord in theRecords
				move record thisRecord to theGroup
			end repeat
			if closeDatabase = true then
				delay 2
				close database "c. Twitter"
			end if
		on error error_message number error_number
			if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
		end try
	end tell
end performSmartRule

Smart (3.8 KB)

Actually the next release will completely refactor the handling of smart rules and especially the queueing of actions. This should especially fix such random issue like this one.