Move to folder with merge

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

Moderator: Mr_Noodle

Move to folder with merge Tue Dec 20, 2016 7:17 am • by rooster
I'm having trouble finding out how best to move a folder to another location, with the same name.

Currently I have the following action on a matched folder: 'Move to folder: [folder name]' with the options: 'If file exists, rename the file' and 'Copy folder structure' set to: 'parent folder only'

The issue I'm having is that the as a folder is moved, the location receives multiple folders, eg:
Source:
    folder-name

Destination:
    folder-name
    folder-name-1
    folder-name-2
    folder-name 3

And each folder contains a portion of the source folder contents.

I guess the folder must be copying in several stages, and the renaming kicking in, but is there a way to prevent this, and use an 'if file exists then merge' type approach?

Any support appreciated!

Thanks!
rooster
 
Posts: 2
Joined: Tue Dec 20, 2016 7:08 am

Re: Move to folder with merge Tue Dec 20, 2016 1:26 pm • by Mr_Noodle
There is no built-in merge capability with folders. You could have Hazel go into the subfolders and operate on each file individually. There you can set it to overwrite the old file if it already exists.

Note that you'll need a special rule to tell Hazel to go into subfolders as described here: https://www.noodlesoft.com/kb/going-into-subfolders/
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Move to folder with merge Tue Dec 20, 2016 1:38 pm • by rooster
Thank you for the quick reply.

In that case I'll probably do this using a shell script - what does the $1 variable contain when referencing in the embedded script?

Is there a way to pass the folder structure from the watched folder to the script as well?

Thanks
rooster
 
Posts: 2
Joined: Tue Dec 20, 2016 7:08 am

Re: Move to folder with merge Wed Dec 21, 2016 1:10 pm • by Mr_Noodle
The argument is a full path to the file matching the rule. That should also contain the watched folder since the matched file should be somewhere under it.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support