Page 1 of 1

Run a rule right after after files finish copying

PostPosted: Tue Aug 09, 2011 1:36 pm
by justinkthornton
I have this rule that I'm trying to run when a group of files is finished copying the folder the rule is looking at. But the files have to be finished being copied into the folder.

Right now I'm using the date last modified is not in the last minute. That works, but because of the nature of what I'm trying to do I would like it to move faster.

So here is what I'm doing. I'm designing a somewhat complicated file management system for my photography. (I'm a commercial photographer and I've grown out of my old way of doing things.) I'm using hazel, automator and applescript to cobble together a way of forcing myself to follow this system strictly. (I tend to be lazy when I comes to file management) So naming is important and I use hazel to generate most of this complex naming structure I have devised.

But there a few parts of the name that change from shoot to shoot. So I have a automator action in witch you can do a search and replace on a name with information it ask from me when it runs. But if I do this with a rule that identifies the files themselves the automator action processes them separately because hazel identifies them individually. So if I identify the folder they are in as the target of the hazel rule the automator action in do its stuff in a batch. The problem lies in building a rule that can tell when the files are finished moving and run the rule on the folder that they are in.

I could wait that minute, it wont kill me. But I want to get on with it. Any Ideas?

Re: Run a rule right after after files finish copying

PostPosted: Wed Aug 10, 2011 2:50 pm
by Mr_Noodle
I'm a bit hazy on the exact workflow here. Is the Automator action processing the files in place and then you want Hazel to process each file as Automator is done with them?

One thing you can do is have the Automator action move the file to another folder when it's done and then have Hazel process files in that new folder.

Re: Run a rule right after after files finish copying

PostPosted: Wed Aug 10, 2011 3:34 pm
by justinkthornton
That's not not what I'm trying to do.

I'm coping pictures from a cf card. Hazel renames the file impart then sorts it into the proper subfolder. The I want hazel to see that the file is finished and run an Automator workflow. But here is where the problems start.

If a attach the rule to the folders that rule is looking at, Automator will process the files individual instead of in a batch. I understand why, hazel doesn't work in batches. But this automaotor action asks me to give it text so it can replace part of the file name with a more relevant term for this batch of files. So the filename is generated in part by hazel and in part in Automator. So if I but it here the dialog box that I enter the term into will come up for evey file.

To make the Automator action batch the find and replace I have to put it in a hazel rule in the parent folder that targets the folder in the files they are in. The only way I can think of for the rule to wait until the files are finish copying to the folder is use the date last modified feature. That means I have to wait a minute, no the end of the world but I would like to speed things up.

Maybe there is a simpler way of doing this.

Re: Run a rule right after after files finish copying

PostPosted: Fri Aug 12, 2011 3:55 pm
by Mr_Noodle
There's no way for Hazel to know when it's done since it doesn't know how many files will be copied over. You need to do something more explicit like color the parent folder when it's done.