Mark items as read automatically

For one of the folders in my database, I don’t want to see my items as unread. In a previous thread, someone suggested to attach a ‘mark as read’ script to the folder. I did so, but nothing happened.

I figured it would only take effect for new items. But even new items in the folder are showing up as unread. Am I doing something wrong, or is there a better way to mark items as unread automatically?

Thanks!

Perhaps if you posted your script someone here would take a look at it.

Here’s the script.

tell application "DEVONthink Pro"
	set unreadItems to search with unread
	repeat with unreadItem in unreadItems
		set unread of unreadItem to false
	end repeat
end tell

I downloaded it from the Extras section. It works fine when I run it from the scripts menu, just not when it’s ‘attached’ to the folder.