Incorrect renaming of a folder?

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

Moderator: Mr_Noodle

Incorrect renaming of a folder? Tue Mar 19, 2019 12:44 am • by adifish
I had the perfect set up! File in a folder gets downloaded, folder inc contents gets moved to a staging area for further sorting. Once matched, the file within moved folder gets renamed to match folder name(plus extension) and then moved to final destination.

Example Folder:
"filetype.filename.date.time"
File within the folder:
"filename.date.time.jpg"

My renaming would therefore add the filetype to the name of the file "filetype.filename.date.time.jpg"

The renaming above worked, I was happy :)

The folders/files I am downloading have now changed and now include the URL of the site I am downloading them from.
Example Folder:
"www.websitename.com - filetype.filename.date.time"
File within the folder:
"filename.date.time.jpg"

I thought it would be a simple case of adding a renaming action to the rule that moves the folder to the staging area and within that action to use the conditions to replace "www.websitename.com - " with "" and the folder would be renamed with the remaining "filetype.filename.date.time". But it doesn't seem to be working that way, in fact it's working in a way which makes me think there's a bug somewhere and what it ends up doing is renaming the folder "www.websitename"

Also, when trying to match "www.websitename.com" using the condition "contains"/"starts with" etc it doesn't match (at least it doesn't when testing the rules, although sometime does when the rules are run)

Am I right in thinking Hazel is failing because of all the .'s in the file name? Is there a way to remove all the .'s and replace with spaces to get things on track? Or is that just putting a sticking plaster on the problem?

I hope that all makes sense :) .. Any help would be appreciated!
adifish
 
Posts: 1
Joined: Tue Mar 19, 2019 12:13 am

Re: Incorrect renaming of a folder? Tue Mar 19, 2019 10:53 am • by Mr_Noodle
Well, everything after the last dot would be considered the extension though I'm not sure if that is the issue here.

It might be better to use match patterns (search the help for them). You can then use a custom attribute to match the part of the name you want to keep so you can use that to rename the file.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support