Page 1 of 1

Move to new folder I will name before files move?

PostPosted: Mon Dec 13, 2021 2:27 pm
by markyodo
Is there any logic for a rule to move files to a folder were the folder is not named in the rule?
I created a Keyboard Maestro trigger to prompt for a folder name and create a folder with that name.
I want to use Hazel to trigger this with a shortcut and move files to this newly created folder but I can't figure out how to instruct Hazel to move files to a folder that was just created.
Thanks in advance.

Re: Move to new folder I will name before files move?

PostPosted: Tue Dec 14, 2021 10:21 am
by Mr_Noodle
Where are these files in relation to the folder?

Re: Move to new folder I will name before files move?

PostPosted: Tue Dec 14, 2021 2:10 pm
by markyodo
Mr_Noodle wrote:Where are these files in relation to the folder?

The files exist on an SD card or device connected to the computer via thunderbolt.
My logic looks like this:
Determine device connected. Hazel does this based on naming convention of the device plugged into thunderbolt.
Launch shortcut to prompt folder name & create new folder in a specific directory tree.
Copy files from SD card to newly created folder.

Thanks.

Re: Move to new folder I will name before files move?

PostPosted: Wed Dec 15, 2021 9:03 am
by Mr_Noodle
Is there some way the folder name can be derived automatically instead of having you enter it? Maybe some examples would help there.

Re: Move to new folder I will name before files move?

PostPosted: Fri Dec 17, 2021 9:26 am
by markyodo
Mr_Noodle wrote:Is there some way the folder name can be derived automatically instead of having you enter it? Maybe some examples would help there.

Unfortunately not. The reason for the input is to create a top level project folder with nested folders for project content.
Example:
I plugin a DJI Drone to import video and photos, Hazel actions watch for the specific name/location when the drone is plugged in. Currently Hazel knows based on device name, location, and file prefix, and extension (video, photo) that it's DJI drone content and copies the files to nested folders based on this info.
What I wanted to do is add a step that asks for a project name, create the project folder, then move the files to this project folder. It would be nice if Hazel could take the input from keyboard maestro for the project name and just move the files directly.
Currently it's a 2 step process. Using keyboard maestro I can do this and currently it asks for a project name, creates project directory, and moves any "new" files that Hazel had previously moved in step 1, effectively moving the files 2 times.
Thanks.

Re: Move to new folder I will name before files move?

PostPosted: Fri Dec 17, 2021 9:37 am
by Mr_Noodle
You'd probably need to write a script as there doesn't seem to be any relationship between the source and destination. It would make more sense to monitor the folder where you create the destination, since that is the trigger but there is no "copy from" action.

Only other way I can see this working is that instead of having KM create a folder, instead, have it tag the files directly with the name of the folder. You can then specify a move to the parent folder, then use Sort into subfolder with the tag.

Re: Move to new folder I will name before files move?

PostPosted: Fri Dec 17, 2021 10:14 am
by markyodo
I like both of those ideas. I will do some testing.
Thank you very much!