Quantcast
Channel: DEVONtechnologies Community - Latest posts
Viewing all articles
Browse latest Browse all 16117

How to get smart rule to act on tags created on documents

$
0
0

Here’s what I have

For clarification, the script code again

function performsmartrule(records) {
	var app = Application("DEVONthink 3");
	app.includeStandardAdditions = true;

	records.forEach (r => {
		if (r.type() === "tag") {
           app.logMessage(r.name());
        } else {
            app.logMessage(`triggered for document type ${r.type()}`);
        }
	})
}

And in DT’s log messages, I get “triggered for document type group”. Investigating further, the name property of this “group” is, in fact, what I entered as name for the new tag.
Is that what you were after?
The type of the new tag being “group” instead of “tag” seems a bit weird at first, but since the tag is shown to “contain” the record that has been tagged, that might be ok.

screenshot.png


Viewing all articles
Browse latest Browse all 16117

Trending Articles