Rules fail when multiple files dropped into folder

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

Moderator: Mr_Noodle

I have created a series of nested folders and sequential rules which iteratively build a filename based on information in the contents. These are for property rental statements where I want to build the filename as:

Statement.pdf
Statement - [Agency].pdf
Statement - [Agency] - [Property].pdf
Statement - [Agency] - [Property] - YYYYMMDD.pdf

An example filename would be "Statement - Smith & Co - 2B Sailor St - 20210531.pdf"

...and add appropriate tags...and then move to the correct folder based on property name AND date suffix

I suspect there's a smarter way to do this without all the folders and steps, but I've set it up to work something like this:

1. (First folder) File Contents checked for matching criteria to be a rental statement. If true, rename as "Statement.pdf"
2. File moved to next folder where new rules are triggered...
3. File Contents checked to determine name of Agency managing the property. There is one rule for each of the Agencies. Rename file --> Filename = [name] & " - " & [agency]" (so it appends the agency name to the original filename which was previously called "Statement".
4. File moved to next folder where new rules are triggered...
5. File Contents checked to determine which property (Some agencies manage multiple properties). There is one rule for each property. File renamed to append " - [Property]"
6. File moved to next folder where new rules are triggered...
7. Suffix of " - YYYYMMDD" added to file based on file creation date
8. File moved to new folder
9. Final step evaluates based on Property (now part of filename) and creation date (now part of filename) where the file finally gets moved to

The reason I've set up a series of cascading folders for each filename iteration is that I was seeing problems with looping...so I would end up with a file called "Statement - [Agency] - [Property] - [Property] - [Property] - [Property].pdf" !! (If there's a smarter way, let me know!)

Anyway...this all works very nicely (and it's kind of satisfying to watch)...for a single file...the trouble starts when I drop a number of files into that first folder all at once (and I need this to work with multiple files). The first issue is that the first part of the filename is appended with an enum...Statement, Statement-1, Statement-2 etc during the first step (I understand why). Depending on how things unfold, that enumeration might instead appear after the Agency is added. So, Statement - [Agency]-1, Statement - [Agency]-2 etc (when the Agency is the same). I've solved for this with a rename rule that replaces any -x enumerations after the property name is added (which makes each file unique by that step). I learned about creating tokens with an "Anything" rule to solve this - nice!

So it still works...but...

That's only part of the problem. When I drop a number of files on that first folder a couple of other things happen:

A. Rules work on the first few files, but not the rest. Sometimes I can re-trigger rules by opening and closing the file that's part way through it's "process" (through the rules & folders). Sometimes this will "unblock" it all the way to the end, but other times, might only trigger the next rule and move to next folder before it's "stuck" again.
B. Contents match rules stop working after a few files...sometimes this can be solved by modifying the rule to look for a match (with anything instead of a space). It's weird, one file will match successfully on Contents contain "Smith Agency" and the next file which has "Smith Agency" will not match...but matches if I change the rule to Contents contain match "Smith(...)Agency". And later I'll change the rule back to Contents contain "Smith Agency" and it works again.

Sometimes the files will find their way through this if I just wait long enough, but not all of them...sometimes opening and closing them (per A above), but not always. Quite frustrating.
Lachlan Williams
 
Posts: 13
Joined: Fri Jun 11, 2021 4:06 am

I'm not sure if it's a good idea to do it in separate steps. If possible, I would look into consolidating that all into one rule. There is probably no way to avoid the numbering when you have several files with the same name in there so the best solution would be to make the names unique as soon as possible.
Mr_Noodle
Site Admin
 
Posts: 11226
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support