Question about tag overlap when highlighting multiple documents

Quick question to determine whether this is a bug or not.

I have a specific smart group that will populate based on one particular tag: hearing. The group changes all the time, so I want to be able to go into that group, highlight all the docs, and remove the hearing tag. However, this doesn’t work unless every single document in the group has the exact same tags as every other document in the group.

Simple Example: TagA, TagB, Hearing. Two different documents have all those tags. If I highlight those two documents in the list view, all three tags show in the inspector and tag bar. But add TagC to one of the documents, tag bar and inspector are now blank. This is not what I would expect.

If I highlight multiple documents anywhere in DT, shouldn’t the inspector or tag bar reveal every tag those files hold in common, regardless of what tags they don’t have in common? If this is not expected behavior, can it be implemented? Thanks.

This is the correct behavior: common tags are not (and have never been) shown unless all the tags are common on the selected documents. And the AI > Tags inspector only handles one selected item at a time. Development would have to assess a change in this behavior.

That being said, you don’t need to use the Tags bar or Info inspector to remove the tags. You can use a simple batch process configuration with any selection, not just in the smart group…

In all these years I’ve never had occasion to do such a thing, so I assumed what the default behavior would be. Thanks for the batch process tip; will give it a go.

You’re welcome!

The batch process suggestion was my first thought too. But your post inspired me to write this script as a little exercise, so I might as well share. It presents a dialog listing all tags applied to selected items (not just those in common):

/*	Remove chosen tags from selection
	Written by troejgaard on Apr 7 2026
	
	- Presents a dialog listing all unique tags applied
	  to selected items, sorted by frequency.
	- Chosen tags are removed from any selected item they apply to. */

(() => {
	const app = Application("DEVONthink");
	app.includeStandardAdditions = true;
		
	const sel = app.selectedRecords();
	const itemCount = sel.length;
	const selTags = app.selectedRecords.tags().flat();
	const uniqueTags = new Set(selTags);
	
	const tagsByCount = Array.from(uniqueTags.keys(), tag => {
		const tagCount = selTags.filter(t => t === tag).length;
		return [tag, tagCount];
	})
	.sort((a, b) => b[1] - a[1]);
	
	const tagList = Object.fromEntries(
		tagsByCount.map(([tag, tagCount]) => [
			`${tag} (${tagCount}/${itemCount})`, tag
		])
	);
	
	const chooseTags = app.chooseFromList(
		Object.keys(tagList),
	 {	withTitle: "Remove Tags from Selection",
	 	withPrompt: "Here are all tags applied to selected items, sorted "
	 		+ "by frequency. Choose any you wish to remove:",
	 	multipleSelectionsAllowed: true,
		emptySelectionAllowed: false,
		okButtonName: "Remove",
		cancelButtonName: "Cancel",
		givingUpAfter: 180,
		});
	
	if (!chooseTags) return;
	const tagsToRemove = chooseTags.map(t => tagList[t]);
	
	// Safety check for good measure. Just remove if it feels unnecessary:
	const userConfirmation = app.displayDialog(
		"Remove these tags from selected items?\n" +
		tagsToRemove.map(t => `  • ${t}`).join('\n'),
	 {	withTitle: "Confirm Tag Removal",
	 	buttons: ["Cancel", "Confirm"],
		cancelButton: "Cancel",
		defaultButton: "Cancel",
		});
	
	sel.forEach(rec => {
		const oldTags = rec.tags();
		const newTags = oldTags.filter(t => !tagsToRemove.includes(t));
		rec.tags = newTags;
	});
})()

(Written in JavaScript for Automation)

6 Likes

That’s cool. I’ll check it out!

That would be lovely. This would be helpful if one wants to refactor his tag system or clean up tags automatically created.