Changing tag names

I accidentally made two similar tags in a document: USA and usa.

I want to make all of them read the same: i.e. usa.

Any way to do that

Thanks

Easy!

Make an agent:

query: $Tags.contains("USA");
action: $Tags=$Tags-"USA"+"usa";

In other words, find all the notes that have the. tag USA. When you find such a note, take “USA” out of $Tags and add “usa” to $Tags.

2 Likes

Thanks!

@eastgate solution is great. Here is an alternative approach.

$Tags=$Tags.lowercase.unique.

This will put everything in tags to lower case and then force this list so that are only nique values.

NOTE: this assume you want “everything” to be lowercase in $Tags, not just “usa”.

1 Like

Since $Tags is a set, I believe you don’t need .unique.

1 Like

You’re right. I was thinking it was a list. :wink: