Globally change group and smart group icons

It’s possible with custom meta data and two smart rules. One searches for groups, one searches for smart groups whose custom meta data “icongeaendert” is 0.

Set up your custom meta manually and set it to 1 for Inbox , Annotations and Tags as you probably don’t want to change these icons.

Only tested it on a test database (not on all databases and the global inbox), so maybe I’ve missed something…

-- Change icons

property iconPath : "/Users/user/Desktop/Test.png"

on performSmartRule(theRecords)
	tell application id "DNtp"
		try
			repeat with theRecord in theRecords
				set thumbnail of theRecord to iconPath
				add custom meta data 1 for "icongeaendert" to theRecord
			end repeat
			
		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