running action on original folder after file copy

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

Moderator: Mr_Noodle

Apologies if this is difficult to follow, as I'm just starting to use Hazel (this is my second day) and not fully aware of the terminology etc

I have set up a rule that copies and renames files from "folder A" to "folder B".

This leaves the original file with their original file names in folder A, which is as expected.

I now want to rename the files in folder A, BUT only after the copy to folder B and renaming the files in Folder B has completed.

I want the files to have the same file names in both folders, eventually. However, the idea is that when the files in folder A change their names, I will know the copy to folder B has completed.

But it seems that once the copy rule has been run, the focus of future actions is on Folder B.

How do I bring the focus back to the original Folder A, so I can run a rename rule on the original files.

Of course, there might well be a better way of doing this, so any other suggestions are welcome.
myotis
 
Posts: 6
Joined: Thu Apr 04, 2024 6:22 am

When using the Copy action, subsequent actions in the same rule operate on the copy. One workaround is to use the Sync action. When copying files, it will do the copy but subsequent actions will still apply to the original file.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks, but I'm not sure if this will work for me, as I'm not simply copying and renaming the files I'm also building a folder structure in the target folder, which doesn't match the source folder.

However as I continue to peruse the manual, I wonder whether a notification rule might do what I want.

That is:
Rename the files in Folder A
Copy them to Folder B with a folder structure dictated by photo creation date, and then run a
Notification rule pop up (with sound) to tell me the rename and copy had been completed.

The idea of renaming the files in folder A, after they had been copied to folder B, was simply to stop me working on the files in folder A until after I knew they had been copied (backedup) to Folder B.
myotis
 
Posts: 6
Joined: Thu Apr 04, 2024 6:22 am

As a follow up to my suggestion in the last post, renaming before copying and then triggering a notification when the files have been renamed and moved works well.

The only issue I had was that I triggered an infinite loop of Hazel renaming and copying the renamed files, because it was recognising the renamed files as "new" files.

But in the copy options line I found the "do not copy if duplicate" option, which prevented the continual cycle of renaming and copying.

I now have a couple of other rules set up to delete weekly back ups after they are older than 6 weeks, which also seems to work well. This was much easier to set up than I expected (I've only had the trial a few days), I will definitely buy a license.
myotis
 
Posts: 6
Joined: Thu Apr 04, 2024 6:22 am

It might be a good idea to add conditions to the original rule to detect if something was the result of a previous copy action to prevent it from matching. You could add a tag or comment to it, for example.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support