Smart rule to change file name

Hello everyone,

When I add a file to the database via the sorter, it gets a name convention which I’d like to change with a smart rule.

the file convention is like this: United States - Wikipedia
I want the smart rule to delete the “- Wikipedia” part and leave the rest.

How do I do that?

Thank you all

A smart rule like this should work, it’s not necessary anymore to use scripts:

Thank you, @cgrunenberg.

The smart rule works for English names, but most of my files have Hebrew names. When I try to imply your rule to a Hebrew name, it doesn’t work for some reason.

I’m sure I do something wrong here.

The conditions are probably not correct. Here’s a generic example:

Do you think it’s got to do with mix direction (RTL and LTR)?

No, your conditions look for a Hebrew suffix but your actions expect a Hebrew prefix.

I try to change the rule to this

But it does not work
I can’t fix it. please help

Three things:

  • could you please post an example of a (complete) Hebrew file name you are expecting the rule to work on (as text, rather than as an image, please).
  • I would suggest a step-by-step approach; initially set the rule up to work only on your Hebrew suffix.
  • Your rule is currently set up to run on any document (Any of the following are true: Kind is any Document); check the differences between Criss’ generic rule and yours.

Also, your rule (if it were set up correctly) would run on “suffix” but then you scan for " - suffix"; it would make sense for both terms (i.e. the rule criteria and the action) to be the same.

Thank you, @Blanc, for your response.

  1. text files are not allowed to be uploaded here.

  2. I tried to set the rule to work for Hebrew file names only, and still no luck

Change the condition Name ends with to Name begins with. Does this work?

no. this way, the group is not populated at all

In that case the Scan Name action is probably incorrect, instead of * whatever - try * - whatever.

Still no

Sure, but please simply post the name of a file in plain text - I can’t type Hebrew here, and I can’t experiment without an appropriate file name. Simply post the filename so as I can copy & paste.

The “-” between the sections of your filename is not a simple hyphen in your image (it looks like one of those longer hyphens which Word creates); but you are using a simple hyphen in your smart rule. That may be the problem. Possibly try copy&paste the hyphen from the file name to the smart rule.

file name example
אייזק ניוטון – ויקיפדיה

I tried to change the hyphen with no luck.

The following rule works for me:

The result is a file called אייזק ניוטון, changed from אייזק ניוטון – ויקיפדיה

As far as I can tell, the text I copied from your post was copied with the RTL attribute, so I would hope it should work for you in the same way it does for me. I copied the hyphen directly from your post to the rule; it is not a standard hyphen, so that is necessary.

This is correct, right?

Beat you to it, Jim :stuck_out_tongue: :stuck_out_tongue_winking_eye:

Yep, I see your results. Just bumping to see if the results are the expected ones :slight_smile:

The OP actually did the right thing initially, but was caught out by the hyphen.