Are 3 different IF in one method possible?

#1 : 15/07-25 12:49
Alexander
Posts: 8
Hi, how do I script such a case.

If name contains "aaa"
do this
and this
and this
If name contains "bbb"
do this
add this
change that
If name contains "ccc"
do something different

Is such a renaming method possible?
Or do I have to split this procedure into 3 different renaming methods?

Alexander
#2 : 16/07-25 05:45
Delta Foxtrot
Posts: 529
Reply to #1:

Hi Alexander,

I don't know how much you know about regex and javascript, but you can do this with either. If you use javascript you can do it in one script method; depending on what exactly you want to do it probably wouldn't be that hard to script. If you use regex you are going to have to use multiple methods, or maybe one or two List replace method(s) with multiple interior replace/with pairs. I'd need more information on exactly what you are doing in order to be more specific.

Best,
DF
#3 : 16/07-25 07:11
Alexander
Posts: 8
HI DF,

Currently, I’m utilizing the {if} function to divide the preset into three parts based on the original file name. While it works, the view isn’t particularly clear to me. I have to look at the details every time to see which command is applied to which {if}.

I’ve used “A better file Rename” so far, and I believe the overview is better displayed in this app. Perhaps there’s an idea for a future “Advanced Renamer” version?

Screenshot:
https://app.screencast.com/hCT4MsRi7ZQYH

Alexander

edited: 16/07-25 07:28
#4 : 16/07-25 23:12
Delta Foxtrot
Posts: 529
Reply to #3:

I tried that other program but 1) no scripting, and 2) if you have lots of criteria you end up doom-scrolling forever. There might have been something else but I don't remember.

I religiously document my methods, and I find that's the best of all worlds for me, having the "headline" right there as a "comment", taking up only one line where I can see it at all times. If I were to use an {if} clause I'd document it in the always-visible method comment line so I wouldn't be trying to figure out what each one does. The main reason I don't use it is that just adding more methods is much more powerful (with the side benefit of that aforementioned ease of documentation).

And I couldn't exist without scripting.

Different strokes, though, right? :)

Best,
DF
#5 : 17/07-25 06:55
Alexander
Posts: 8
I also like Advanced Renamer much better.
The only thing I find clearer is the way the {if} sections are displayed.

I'll have to get to grips with scripts first, I have no idea about them at the moment.

Best,
Alexander