Copy Existing Documents to Newly created Sub-Folder

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

Moderator: Mr_Noodle

Greetings,

I am using Hazel to automate our document generation. Using Hazel, I have had success populating appropriate sub-folders in client main folders after they are pushed to our external hard drive by our CRM, Hazel watches the entire HD and executes the sub folder population (it's wonderful).

My goal is now to have the appropriate "boiler plate" forms, in .PDF, "cloned" into the new sub-folders from a "feeder" folder.

I have been trying different combinations of Hazel and Automator rules to no avail.

Has anyone had any success with this?

ChrisB
ChrisB
 
Posts: 4
Joined: Mon Dec 05, 2016 4:42 pm

A little unclear on your workflow but maybe if you post what you have so far and how it isn't working, that would help.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks for your response, I think the problem may be with Automator and not Hazel.

But here goes, So far,

I have our Web CRM creating client folders on my external HD through my MAC.

Hazel then creates appropriate subfolders (I have rules in place to populate specific sets of subfolders based on what kind of work we are doing for the client).

What I need is to create a way to copy existing document templates (mostly .PDF files) into those newly created subfolders.

I have done a fair bit of research, but I haven't seen where anyone has had ay success with this.

I consistently get directory errors from automator.
ChrisB
 
Posts: 4
Joined: Mon Dec 05, 2016 4:42 pm

What is the Automator action doing specifically? Is it something that can be done with Hazel's built-in actions instead?
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I would love it if Hazel could do this. But Hazel doesn't seem to do well with getting documents.

I am using these Automator commands:

Set Value of Variable : New Variable "Subfolder"

Find Finder Items : Search <Folder> Parameters <All> of the following are true <Kind> is <PDF>

Copy Finder Items : To: "Subfolder"

This is one iteration, the most recent, I have tried with various other commands including "Get Finder Items" and "Copy Finder Items"

I am getting this error: *** -[NSFileManager createDirectoryAtURL:withIntermediateDirectories:attributes:error:]: URL is nil
ChrisB
 
Posts: 4
Joined: Mon Dec 05, 2016 4:42 pm

You don't want to use any of the "Finder Items" actions as those use whatever happens to be selected in Finder at that moment.

Not sure where things are going wrong but I suggest debugging the workflow outside of Hazel. Keep in mind Hazel does pass in the full path of the file matched by the rule into the workflow.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I finally made this work.

Using the following Automator commands:

- Set Value of variable to "Primary Folder"

- Get Specified Finder Items <Select the docs to copy>

- Copy Finder Items to "Primary Folder"

The workflow prompts a Hazel warning that the Automator function has "failed" even though it successfully populates the docs.

Thanks for the help. :D
ChrisB
 
Posts: 4
Joined: Mon Dec 05, 2016 4:42 pm


Return to Support