Rename Foldername, just deleting certain words?

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

Moderator: Mr_Noodle

Hello

I really love Hazel, currently in Trial version.

I already checked the help documents and searched the board here...

So my problem is the following:

My clients uploading files over my wix homepage into my dropbox folder. The wix to dropbox app adds automaticlly a stamp as followed:

"Uploaded at 1035 UTC, 09-20-18 from example@clientemailadress.com"

What I want is, to extract just the email address, but of course, it's always different since I have different clients. ;-)

Basically, I want to rename the folder just with the clients email address, to copy this address for further automation in apple script etc.

Is this somehow possible to realize with hazel?

Thank you very much for your help.
Silvano87
 
Posts: 5
Joined: Sat Oct 13, 2018 11:46 am

Search for "match patterns" in the help. There's a chapter which should cover this. If you need more help after that, post back here.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Search for "match patterns" in the help. There's a chapter which should cover this. If you need more help after that, post back here.


Hello and thank you very much, this helped me.

So I could set it up that the name matches the file. But I have problems to rename (remove), just the pattern before the email address, so the action should be:

Rename BUT should let the email address there in the filename...

"Uploaded at 2007 UTC, 11-03-18 from example@hotmail.com"

The result should be after the action:

"example@hotmail.com"

Is this possible?
Thank you very much!
Silvano87
 
Posts: 5
Joined: Sat Oct 13, 2018 11:46 am

Yes. Create a custom attribute in your pattern to match the email part at the end. When renaming, use that attribute which won't contain anything else.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Yes. Create a custom attribute in your pattern to match the email part at the end. When renaming, use that attribute which won't contain anything else.


Thank you very much!!

It nearly works, the only thing that I don't get, is the ".com" part...

It matches "Uploaded at 2007 UTC, 11-03-18 from example@hotmail" and then the action is "renaming by my custom made pattern, called "email" which contains attributes with: ab12%?@ab12%?

In my opinion it should work? But it doesn't take the last part ".com" or whatever it is... it's weird, or did I something wrong?

Instead of renaming it with .com or whatever, it renames it with "-1"

I'm soooo close haha. :oops: :mrgreen:
Silvano87
 
Posts: 5
Joined: Sat Oct 13, 2018 11:46 am

Try matching against "Full Name", not "Name". Anything after the last dot is considered the extension which is probably what's causing the issue here.
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Try matching against "Full Name", not "Name". Anything after the last dot is considered the extension which is probably what's causing the issue here.


It works now, awesome thank you!!
Silvano87
 
Posts: 5
Joined: Sat Oct 13, 2018 11:46 am

I have another problem now:

Hazel is doing the renaming, but it also copies the folder, I haven't applied any rule to copy anything.

What it does is:

- renaming the Folder (which doesn't contain the uploaded file in this folder)
- adds another folder which contains the original name with the uploaded file in it?

looks like this:

Folder one:
Uploaded at 1542 UTC, 10-25-18 from testtest@test.com
(uploaded file in it)

Folder two
testtest@test.com
(no file in it)

What's the purpose behind this, really can't find anything that says copy something, the only action is the renaming thing.
Thanks for your help!
Silvano87
 
Posts: 5
Joined: Sat Oct 13, 2018 11:46 am

Can you post your full rule?
Mr_Noodle
Site Admin
 
Posts: 11236
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support