Page 1 of 1

Rename Foldername, just deleting certain words?

PostPosted: Sat Oct 13, 2018 11:51 am
by Silvano87
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.

Re: Rename Foldername, just deleting certain words?

PostPosted: Mon Oct 15, 2018 10:32 am
by Mr_Noodle
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.

Re: Rename Foldername, just deleting certain words?

PostPosted: Mon Oct 15, 2018 12:04 pm
by Silvano87
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!

Re: Rename Foldername, just deleting certain words?

PostPosted: Tue Oct 16, 2018 10:31 am
by Mr_Noodle
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.

Re: Rename Foldername, just deleting certain words?

PostPosted: Mon Oct 22, 2018 11:40 am
by Silvano87
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:

Re: Rename Foldername, just deleting certain words?

PostPosted: Tue Oct 23, 2018 10:55 am
by Mr_Noodle
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.

Re: Rename Foldername, just deleting certain words?

PostPosted: Tue Oct 23, 2018 11:01 am
by Silvano87
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!!

Re: Rename Foldername, just deleting certain words?

PostPosted: Thu Oct 25, 2018 11:47 am
by Silvano87
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!

Re: Rename Foldername, just deleting certain words?

PostPosted: Mon Oct 29, 2018 11:07 am
by Mr_Noodle
Can you post your full rule?