Removing Finder tags without affecting DEVONthink search capabilities

Hi All,

I’m encountering an issue with a large number of tags (~48,000) in my Finder, which I believe might be slowing down Finder operations like adding new tags and saving files. I suspect that DEVONthink might have created these tags at some point when I imported files through sources like RSS feeds. I have checked the settings in DEVONthink and confirmed that tags are not being automatically created anymore.

To resolve the issue, I plan to remove these unwanted tags from my system while keeping a specific list of tags intact. I’ve received a script that can achieve this, which involves comparing the current Finder tags with the ones I want to keep and removing the rest from Finder’s preferences.

Before I proceed with this solution, I’d like to get your opinion on whether removing these tags from Finder could potentially impact search capabilities or any other functionalities within DEVONthink. Additionally, if you have any suggestions for a better way to handle this issue, I would greatly appreciate your input.

Here’s the script I received for reference:

# Create a temporary file for the tags to remove
touch tags_to_remove.txt

# Read all current tags and compare them with the tags_to_keep.txt
all_tags=$(defaults read FavoriteTagNames)
for tag in "${all_tags[@]}"; do
    if ! grep -q -F "$tag" tags_to_keep.txt; then
        echo "$tag" >> tags_to_remove.txt

# Remove unwanted tags from Finder's preferences
while read tag; do
    defaults delete FavoriteTagNames -array-add "$tag"
    defaults delete RecentTagNames -array-add "$tag"
done < tags_to_remove.txt

# Restart Finder to apply changes
killall Finder

# Clean up the temporary file
rm tags_to_remove.txt

Any advice would be greatly appreciated. Thanks in advance!

  • Jeff
1 Like

Did you read this…

Savior!! Solved. Thanks Jim. I looked for a solution prior to posting but obviously not hard enough.

Much appreciated :beers:

My pleasure :tada::wink: