Page 1 of 1

Dealing with patterns

PostPosted: Thu Sep 23, 2021 4:03 pm
by Harry_Cover
I am fighting with patterns.

At work, I get lots of .dmg files.

Their names are kind of :
Blablaxvz__ABC_defgh.net.dmg


In which:
Blablaxvz

Is the specific part of each file name

and…
__ABC_defgh.net

is the part never modified. Like a signature for all the files.

Il would like to delete…
__ABC_defgh.net


and thus the new resulting file name would be:
Blablaxvz.dmg


Thanks to help me.

Re: Dealing withe patterns

PostPosted: Fri Sep 24, 2021 9:21 am
by Mr_Noodle
In your pattern, you would want to create a custom text attribute to match the first part (the part of the name you want to keep). I'm guessing it would be everything up to the first underscore. You can then probably use an "anything" part for everything after the underscore since you don't care about it. In the Rename pattern, you can then use the custom attribute you defined.

Re: Dealing withe patterns

PostPosted: Fri Sep 24, 2021 11:20 am
by Harry_Cover
Many thanks for quick replying. You guess I am a newbie in patterns.
What you said is exactly what I am trying to do… without succeeding. :(

Re: Dealing withe patterns

PostPosted: Sat Sep 25, 2021 10:33 am
by Harry_Cover
Irrelevant message. Canceled.

Re: Dealing withe patterns

PostPosted: Sat Sep 25, 2021 12:57 pm
by Harry_Cover
I have tried:

1- Name matches: <•2keep><•Trash>
Where <•2keep> and <•Trash> are 2 custom text attributes
with:
<•2keep> is <aaaaaaaaa> or <abc> and
<•Trash> is <__ABC_defgh.net> or <anything (…)>


2- Name matches: <•2keep>__<•Trash>
with:
<•2keep> is <aaaaaaaaa> or <abc>
<•Trash> is <ABC_defgh.net> or <anything (…)>

Does not work. :cry:

Re: Dealing with patterns

PostPosted: Mon Sep 27, 2021 10:15 am
by Mr_Noodle
Have you tried the preview? Does it show the condition matching there?

Re: Dealing with patterns

PostPosted: Mon Sep 27, 2021 1:06 pm
by Harry_Cover
Yes.
No matching issue.

Is there anyone who would be kind enough to share with me, an example of a similar example working on his machine ?
A simple renaming process should be simple enough to avoid using other specialized utilities (NameMangler, etc), no ?

Re: Dealing with patterns

PostPosted: Tue Sep 28, 2021 9:42 am
by Mr_Noodle
From what you described, it looks ok. When you say not matching issue, you mean it matched? If so, then please follow through with the rest of the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Re: Dealing with patterns

PostPosted: Wed Sep 29, 2021 1:16 am
by Harry_Cover
OK.
I will follow the Troubleshooting Guide and come back to you.
Thanks again.

Re: Dealing with patterns [SOLVED]

PostPosted: Wed Sep 29, 2021 1:57 am
by Harry_Cover
Problem solved. There was an interference between 2 rules.It now works like a dream :D

By the way, what is the use of the "Disable Helper" button in the prefs Debug pane ?

Many thanks again for your precious help.
Hazel is a great utility and M. Noodle is its prophet. :wink: !!

Re: Dealing with patterns

PostPosted: Wed Sep 29, 2021 10:10 am
by Mr_Noodle
Special case where for some reason you need to turn off the helper process entirely. Normally, it will restart itself even if you kill it.