Newbie-Move files to a NEW folder

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

Moderator: Mr_Noodle

Newbie-Move files to a NEW folder Tue Mar 05, 2013 11:05 am • by ijonesj
I am a new Hazel user and have been trying out how to make a rule to cover this scenario:

Folder A>Sub-folders a,b,c,d,e,f,g,h,i

I have "sub-folder a" set to receive certain downloaded files from my company database (.opt and .pdf files). During a typical day I have to download a lot of these files that pertain to various accounts. I typically have to download them, create a new folder for them using naming convention last name,first name, and then move the files out of "sub-folder a" into a new folder I create in one of the subfolders b-i named "last name,first name."

How can I get Hazel to watch "subfolder a' for new files and prompt me to save them into a folder I can place and name how I want to?

I get how to have Hazel move folders to existing folders but I have not seen any discussion on how to prompt Hazel to ask for a new folder to be created.

I have tried using Automator to set up a folder action and while this works, it is too slow.

Thanks i advance for any input I can get.
ijonesj
 
Posts: 14
Joined: Tue Mar 05, 2013 10:40 am

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 12:52 pm • by a_freyer
Do these OPT and PDF files include the client name anywhere in them, or will you always have to set the client name manually?
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 12:56 pm • by ijonesj
I will be naming the new folder manually. I do not need to change the file names of the files themselves, just move them to the new folder I create as, hopefully, part of the Hazel action.
ijonesj
 
Posts: 14
Joined: Tue Mar 05, 2013 10:40 am

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 12:58 pm • by a_freyer
Ok, but I'd like to be clear here - do you NEED to name them manually? Is there anything in the files themselves that you CAN use to extract lastname, firstname?

EDIT - If so, Hazel can do all of this for you really easily
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 1:05 pm • by ijonesj
Well, only the last name appears in one of the files but with other information. To explain, the OPT file is named like this: EAI-LastName-StreetAddress.opt". The folders containing the files should be named "last name first name."
ijonesj
 
Posts: 14
Joined: Tue Mar 05, 2013 10:40 am

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 1:07 pm • by a_freyer
Anything beyond the filename? Perhaps the file content contains the firstname in a findable way?
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 1:10 pm • by ijonesj
Oh sure the first and last name is in both files. In the PDF, since it is a coupon whose format doesn't change, the name is in the same place every time.
ijonesj
 
Posts: 14
Joined: Tue Mar 05, 2013 10:40 am

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 1:11 pm • by a_freyer
If that's the case, then we can do this automatically. Is it possible for you to post either of these types of files, or perhaps a demonstrative file without exposing client information?
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 1:29 pm • by ijonesj
I had to redact a lot of info incl the customer name but you can see the Customer Name field. The PDF is generated by software using PDF form fields. Last name first in that field.
Oh wait, how do I attach the file to this post?

Here is the dropbox link: https://www.dropbox.com/s/5m0aiqnpzttcd ... Street.pdf
Last edited by ijonesj on Tue Mar 05, 2013 1:31 pm, edited 1 time in total.
ijonesj
 
Posts: 14
Joined: Tue Mar 05, 2013 10:40 am

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 1:31 pm • by a_freyer
I'd post a zip to dropbox or something similar.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 1:41 pm • by a_freyer
Well, since you flattened the PDF (first two pages at least), I'm not going to be able to pull any fields from it in the same way that will work for an unflattened version.

How about this: take an unflattened version, and open terminal and run this command (you can drag and drop the file to get the path to print out for you):

Code: Select all
mdimport -d2 path/to/my/pdf.pdf


Look at the text that outputs. You will see that the client name comes up several times. If you can, redact this version and then I would be able to help.


Note, since I have already downloaded the dropbox link and deleted it (not useful) on my machine, you can remove it from dropbox.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 1:57 pm • by ijonesj
They come flattened, it's not something I do so I guess what you were planning will not work.
ijonesj
 
Posts: 14
Joined: Tue Mar 05, 2013 10:40 am

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 1:59 pm • by ijonesj
I am not really hung up on getting Hazel to auto-create the folder name as I am just getting the process automated with my required input (pick location for new folder and name) as part of that process. Like in say an Automator workflow.

Have tried to accomplish by Automator BTW with no luck.
ijonesj
 
Posts: 14
Joined: Tue Mar 05, 2013 10:40 am

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 2:00 pm • by a_freyer
It will still work, but we would have to use a free OCR like tesseract.

However, if you are fine with this being manual, you can find an applescript input dialog I wrote on the tips forum.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

Re: Newbie-Move files to a NEW folder Tue Mar 05, 2013 2:12 pm • by ijonesj
Ok, so this is what I have in my Rule:

If Kind is opt or pdf

Do the following"
Run Applescript (embedded your script).

So does this monitor the folder and when those file types are added, I will be prompted to....?
ijonesj
 
Posts: 14
Joined: Tue Mar 05, 2013 10:40 am

Next

Return to Support