Smart rule: how to append group name to item


I wrote the smart rule below, which changes the label of all items with a name containing “Table of Contents” to Cyan.

I created a smart group listing all items with table of contents in the name, which is problematic because I don’t see which group the file belongs to.

I would like the smart rule to change the name of the item to append the name of the group to which the item belongs. Is there a placeholder to do this or another solution ?

thanks in advance for your time and help

Try a right-click into the field that holds name to open its context menu and pick Insert Placeholder.

By the way, you can mix placeholders and text to generate a name like “<name of the group> TOC” which would allow you a search or a Smart Group with all your TOCs.

1 Like

I did not know about it. Very interesting and useful. works perfectly. thank you

yes, very good idea.

Now that I modify my smart rule following your advice, I am left with one problem. What can I do to ensure that I do not create a self perpetuating process.

For example, I have a file named ronald, and I write a rule saying that that if the filename contains ronald change it to ronald the chicken.

For the 1st iteration of the rule, the file ronald is converted to ronald the chicken. My problem is that each time the rule runs (every new iteration) adds a suffix, so 2nd time I will end up with
ronald the chicken the chicken
and the third time
ronald the chicken the chicken the chicken,
and so on

My question is - with smart rules using rename (here adding a suffix) how do you prevent these recurrent iterations ?

thanks again VERY much for your two very useful suggestions

A second condition maybe?

All of the following are true
Name contains Ronald
Name does not contain the Chicken

This will only work when the re-naming comes with a static part—here: “the Chicken”—that can be used as an “The rule has been applied to this item already so let it alone” indicator.

1 Like

How about this…

Screen Recording 2023-05-28 at 4.36.26 PM

1 Like

that’s the solution. thanks very much !

yes, it’s an idea. I have to work in it. thank you

True, it is the solution for the Ronald the Chicken problem. But it is not the solution for your initial problem, is it? Because I was not exact enough: This will only work when the re-naming Smart Rule adds a static part.

But in you opening post the static part is part of the file’s name already before it gets re-named: “Table of Contents”. What gets added is the non-static name of the file’s respective group. And the placeholder Group Name only works in the Change Name action but not in the Name contains condition (which would be nice, by the way).

So if I got it right there still is an “I have been re-named already” indicator missing.

Could you give examples of the full names of the files before they get re-named? Is it just “Table of Contents”? If so, the solution would be super simple: Replace Name contains Table of Contents by Name is Table of Contents and no second condition would be necessary.

1 Like

you are a genius @suavito !! It’s a perfect and simple solution. thank you very much !

I was following your instructions and writing a new smart rule. I want the name to exactly match “Table of Contents” . Would you happen to know the difference between “matches” and “is” ? thank you


I did not know but you gently pushed me to extend my knowledge:

1 Like

So if I understand correctly, in the rule based on your instructions, I should choose “is” not matches ?
thank you

It should not make any difference in this case. I’d go for is because identicallity is what you are looking for.

And by the way: Glad I could help!

1 Like

thanks again and once again I am extremely grateful