How can I automatically file based project #s?

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

Moderator: Mr_Noodle

First... here are the folders I want to work with:

"Dropbox/ScannerPro"
"Dropbox/In Production/####-Project Name/####-Inbox"
"Dropbox/General/Unprocessed Receipts"
"Trash"

In the second one "####" = the actual project number and the "In Production" folder has a bunch of these folders/subfolders in there.

I want Hazel to watch the folder "Dropbox/ScannerPro" and do the following:

If filename starts with 1401
Copy the file to the "Unprocessed Receipts" folder
Copy the file to the appropriate project inbox based on the number... in this case "1401-Inbox"
Move original file in "ScannerPro" to the trash.

or

If filename starts with 1423
Copy the file to the "Unprocessed Receipts" folder
Copy the file to the appropriate project inbox based on the number... in this case "1423-Inbox"
Move original file in "ScannerPro" to the trash.

And so on.

Basically, I want to be able to "scan" receipts and other docs with the iPhone app ScannerPro, rename the file to begin with the appropriate project number and upload to Dropbox/ScannerPro. I want everything from there automated using Hazel.

I want Hazel to copy the file to the "Unprocessed Receipts" for my bookkeeper to have and then another copy automatically into the appropriate project inbox based on the starting project number in the filename. Then I wanna keep the ScannerPro folder tidy by deleting the original file.

I also want it to ignore any file that doesn't start with a four digit number.

And... I'd rather do this with one or two rules instead of 20+... I'd rather not have one rule for each project.

Is there way to use *'s as wildcards or some other script that would work?

Any help would be great. Thanks!
danatchison
 
Posts: 5
Joined: Wed Mar 12, 2014 11:32 pm

Look up "match patterns" in the help as that should do what you want.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thank you.

I can see how to make the conditions for the files but not how to tell it where to go.

Do I use sort into subfolders? If so, how do I tell it to look for my numbered subfolders that are nested in Dropbox?
danatchison
 
Posts: 5
Joined: Wed Mar 12, 2014 11:32 pm

Sort into subfolders will use existing folders if they exist. If you tell it to use a number and that number turns out to be "1234", then it will use the current "1234" folder if it exists. If it doesn't, it will create it.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

How do I tell it to use a number? The attributes to click and add in the subfolders field aren't the same as in the match field.

Are you saying I have to create a rule for each folder? That's what I didn't want to have to do.
danatchison
 
Posts: 5
Joined: Wed Mar 12, 2014 11:32 pm

You need to create a custom token consisting of numbers. The help article should have an example of doing that. Once you create the custom token, it will be available in the list of attributes when using the Sort into Subfodler action.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Ok... this is very helpful. Thank you.

The challenge I'm having now is that I have pre-existing project folders and I want the file to be moved into a subfolder of those project folders.

Let's use 1403 as the project number

I've got the custom tokens set up for the sort into subfolders but it just creates a new folder and then 1403-Inbox in that new folder.

For example, in the watched folder I put a file called 1403-Filename and I want it to go into 1403-H2-WTF>1403-Inbox.

When I run the rule at present, there's no way to use a wildcard for the project name part of the folder name... "H2-WTF".

It just creates a folder called 1403-Filename and the subfolder 1403-Inbox and dumps it in there.

How can I get it to use just the project number in the first folder level
danatchison
 
Posts: 5
Joined: Wed Mar 12, 2014 11:32 pm

There is no way to wildcard that. One alternative is to select the custom token and do "Replace text...". There you can replace text as needed so you can set up a table of replacements like "1043" -> "1043-H2-WTF".
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

So I basically have to list out all my project names and set up a rename so it goes into the correct folder? What's the difference between that and just have 30 different rules?

so there's no real sort into existing sub folders and sub folder begins with type of deal?
danatchison
 
Posts: 5
Joined: Wed Mar 12, 2014 11:32 pm

It's far more compact than 30 rules and you don't have to replicate the conditions or other actions. Think of it as a lookup table. There is no wildcarding of folder names for this. While it's under consideration for the future, there are issues that need to be resolved like how to handle when no such folder exists or if there are multiple folders which match the pattern.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support