Dealing with patterns

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Dealing with patterns 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.
Last edited by Harry_Cover on Sat Sep 25, 2021 11:12 pm, edited 1 time in total.
Harry_Cover
 
Posts: 7
Joined: Thu Sep 23, 2021 3:54 pm

Re: Dealing withe patterns 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.
Mr_Noodle
Site Admin
 
Posts: 9709
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Dealing withe patterns 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. :(
Harry_Cover
 
Posts: 7
Joined: Thu Sep 23, 2021 3:54 pm

Re: Dealing withe patterns Sat Sep 25, 2021 10:33 am • by Harry_Cover
Irrelevant message. Canceled.
Last edited by Harry_Cover on Sun Sep 26, 2021 12:42 pm, edited 2 times in total.
Harry_Cover
 
Posts: 7
Joined: Thu Sep 23, 2021 3:54 pm

Re: Dealing withe patterns 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:
Harry_Cover
 
Posts: 7
Joined: Thu Sep 23, 2021 3:54 pm

Re: Dealing with patterns Mon Sep 27, 2021 10:15 am • by Mr_Noodle
Have you tried the preview? Does it show the condition matching there?
Mr_Noodle
Site Admin
 
Posts: 9709
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Dealing with patterns 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 ?
Harry_Cover
 
Posts: 7
Joined: Thu Sep 23, 2021 3:54 pm

Re: Dealing with patterns 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/
Mr_Noodle
Site Admin
 
Posts: 9709
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Dealing with patterns Wed Sep 29, 2021 1:16 am • by Harry_Cover
OK.
I will follow the Troubleshooting Guide and come back to you.
Thanks again.
Harry_Cover
 
Posts: 7
Joined: Thu Sep 23, 2021 3:54 pm

Re: Dealing with patterns [SOLVED] 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: !!
Harry_Cover
 
Posts: 7
Joined: Thu Sep 23, 2021 3:54 pm

Re: Dealing with patterns 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.
Mr_Noodle
Site Admin
 
Posts: 9709
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron