Sync by file name only

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

Moderator: Mr_Noodle

Sync by file name only Mon Feb 19, 2018 12:36 pm • by Mike678
I using Hazel combined with Adobe Media Encoder in order to import footage, transcode the footage to lower resolution, then sort the files into two folders, one with the high-resolution footage and the other with the low-resolution footage.

The idea is to quickly watch the low-res footage and if I decide I don't need the footage, then I would delete the file. I was hoping to use Hazel to sync my two folders and thereby automatically delete the corresponding hi-res file. Even though the names of the two files match, Hazel would not delete the hi-res file after I delete the low-res one... I'm assuming this is because the files are obviously not the same despite having the same name.

Is there any way to accomplish what I'm trying to do?
Mike678
 
Posts: 4
Joined: Mon Feb 19, 2018 12:24 pm

Re: Sync by file name only Tue Feb 20, 2018 11:34 am • by Mr_Noodle
Is there any way you can have them both in the same folder? If you do that, you can use a nested condition like:
Code: Select all
    If (all) are met
        Name matches (• vid name)
        <<some conditions to identify the high res version>>
        If (all) are met for (any files or folder in the same folder)
          Name matches (• vid name)
          <<some conditions to identify the low res version>>
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Sync by file name only Thu Feb 22, 2018 5:26 pm • by Mike678
Mr_Noodle wrote:Is there any way you can have them both in the same folder? If you do that, you can use a nested condition like:
Code: Select all
    If (all) are met
        Name matches (• vid name)
        <<some conditions to identify the high res version>>
        If (all) are met for (any files or folder in the same folder)
          Name matches (• vid name)
          <<some conditions to identify the low res version>>


Thanks for the input! I don't think that I would be able to put them in the same folder, since Finder will have an issue with two items being named the same thing. One way around this might be for me to transcode one of the files into a different file format so that they will have different extensions (File.mp4 vs File.mov). In this case I am not sure whether Hazel would match these files though.

Another issue would be that I don't know the names of the video files in advance. When you put "(• vid name)" does that mean I enter the specific video file name? Or is Hazel able to work with variables? I am new to using Hazel so I haven't been able to figure that out as of yet.
Mike678
 
Posts: 4
Joined: Mon Feb 19, 2018 12:24 pm

Re: Sync by file name only Fri Feb 23, 2018 11:48 am • by Mr_Noodle
Ah sorry, •vid name is a custom attribute matching "anything". The first time, it will match whatever is there. In subsequent usages, it uses the original value captured from before. It's a way of making sure they match the same value in both places.

I suggest trying to experiment with nested conditions. You can use them to "climb out" of the folder the file is in and possible enter another. The issue is that there are a limited number of nesting levels so not sure if you can fit in within those limits.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support