Subscribe to the Blog

Hazel Size-Based Rules

One of the great rules I have set up in Hazel is for our news broadcast each morning. It takes the news from the computer it is recorded on, moves it to my computer (with a little Dropbox help) and then moves it to my public Dropbox folder, where another Hazel rule cleans it out after 3 days.

News Rule   Pretty slick, eh?

One problem that I have had is that it has to compress and export from the recording machine, and that can take up to 20-30 minutes. What that means is that I have to wait to run my Hazel rule for 20-30 minutes.

But here is the real problem. When the program I use (BoinxTV) starts exporting, it saves a "placeholder" file to the export location. And its size is Zero bytes, which means that Hazel sees the name of the file, and sees that it has been 20 minutes and then acts on that rule.[1]

Zero Bytes

I figured out a solution today in the middle of a meeting. It came to me like a bolt of lightning. All I had to do was add a little condition to my rule. I set it to only move the file if the size is greater than 0 bytes. That way, it works. Dropbox doesn't update the file incrementally. Dropbox shows the file as 0 bytes or the full 50 MB, and so it is a simple way around that.

Fixed News Rule

This also works with files that are scanned using the ScanSnap. The ScanSnap software also saves a placeholder file while it does OCR on the documents that are scanned. It can take a while when you scan many pages. This size rule can work for those as well.

[1]: The problem with Zero bytes is that Hazel would move the zero-byte-sized file from its location and then the BoinxTV software would not have a placeholder file to write to, so it basically made that file disappear. At least I could never find out where it went!