when a filename matches any of the patterns I provide, I want to slightly rename the filename (lowercase and remove some spaces) and move the file to a different directory. I notice that the second pattern is never matched.
Here are the details:
* file 1: 2016-06-19_Amazon - Order 12345.pdf
* file 2: 2016-06-19_amazon-something-I-bought.pdf
Hazel rules:
- Code: Select all
if any of the following are met
Name matches [{invoicedata}]_[a letter]mazon - [{rest}]
Name matches [{invoicedata}]_amazon-[{rest}]
{invoicedata} = variable of 'CustomDate'
{rest} = variable of 'anything'
The second condition reuses the variables from the first condition.
When I use the preview button on file 1 it correctly matches with the first condition. When I use the preview button on file 2 none of the conditions match.
When I change the conditions to
- Code: Select all
Name contains _Amazon -
Name contains _amazon-
it works correctly on both files, but now I cannot take out the space after 'Amazon'.