Rename: Send do-not-rename flag via Evaluator?

Rename scripts can return true from OnGetNewName() to prevent an item from being renamed.

Can this also be achieved outside a script? Could the Evaluator send a message that instructs the Advanced Renamer/Rename command to skip an item?

Where would it send it from? Not sure I understand.

Let's say I want to move files if they contain a year in their names:

Now, suppose I don't want to move files that lack a year in their names.

Instead of labeling them as "no year", the Evaluator could send a special flag instructing Rename to skip file.txt.

1 Like

Just realized: Returning any illegal character (like <>) stops Rename - quite elegantly, without error messages :wink:

However, there's no indicator in the file list.

2 Likes

Point well taken.
I know this was only a dummy rename to test a hypothesis, but I worked on it some too.
Attempting to keep with the spirit of this, I found this.

We've added this for the next update.

3 Likes

Works fine 13.16.6 :+1:

In case anyone wants to try it out:

{=d = RegEx(name, ".*?((19|20)\d{2}).*", "\1", "e"); d == "" ? Cancel() : d=}\*
3 Likes