Failsafe move item after download finished or after opened

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

Moderator: Mr_Noodle

I've been using Hazel for nearly a year now and while I love it I find that sometimes Hazel misbehaves and I end up spending more time trying to get her to act correctly than I would had I moved the files myself.

Basically I'm looking for a fail-safe way of moving files from my downloads folder elsewhere. My problem is either a) a lot of times the file will move before it's finished downloading or b) the file will get trashed before I've opened it.

Here's two basic scenarios:
For my movies, any videos I download I have moved to a folder on my desktop named To Watch (when something's in this folder hazel turns it orange to tell me I need to watch something, works great!). The problem is depending on how I download it whether through Firefox or elsewhere, Hazel sometimes moves the file before it's completed. Now I've tried to use DownThemAll when downloading from Firefox as that always uses just one file with a .dpart extension so it's not caught. But when I can't Firefox will sometimes have the file with the normal .avi, .mov extension as well as the .part and this is what confuses Hazel. Currently my rules look like this:

Kind is Movie
Color Label is not red
----------
Move file to folder: To Watch

The other scenario I have is for Archive files (.dmg, .zip, .rar) Basically I tell Hazel, trash this if the date opened is after date added. But a lot of times it gets trashed before I even get to open it. I think this is another case of the files downloading as their normal name. For example I just downloaded a VLC update straight through their app. It downloads as a .dmg straight to the downloads folder. So Hazel catches the date added as say 10:00pm (when it first starts downloading) but the Date Last Opened is marked by Leopard with the time it finishes say 10:15pm. Since the Date Last Opened is after, it trashes it.

Date Last Opened is after Date Added
Kind is Archive
Date Last Opened is not blank
Color Label is not red
----------
Move file to folder: Trash

I had a seemingly stroke of genius to include Unarchive file before it gets trashed... but when I do that for a DMG, nothing happens. The rule matches but it doesn't open the image and nor does it trash it.

Would it make more sense to use something like Date Last Opened is after Date Modified? I know I could time restrictions like Date Last Added in the last hour... but this drives me nuts. Sometimes a movie file takes 2 minutes to download, sometimes it takes 2 hours... so how do you pick a time frame? I end up waiting for Hazel to move it, or move it myself... or else I open the file before it's moved to watch it.. then it get's moved to my to watch folder and doesn't get moved out till I open it there! ARG!

I'm hoping some people will have some suggestions as to what I could do the have Hazel be a bit more fail safe when moving around my downloaded files.
SpiceLMF
 
Posts: 5
Joined: Sun Dec 14, 2008 7:54 pm

I just realized that adding the Unarchive File to the rule... was just creating a folder with nothing in it and trashing the folder, not trashing the .dmg. So that could be why it seemed like nothing was occurring... still doesn't help me much though :(
SpiceLMF
 
Posts: 5
Joined: Sun Dec 14, 2008 7:54 pm

There are a few issues here.

One is Firefox. Normally, Firefox will download stuff and have a separate .part file. That is what Hazel looks for to determine whether the file is not finished downloading yet. The problem is that Firefox is inconsistent about this. I had filed a bug with them a while back and but have not received a satisfactory response or explanation. You need to play with your download settings to make sure it behaves this way. I don't know about DownloadThemAll but will look into it though they really should have just used the convention that Firefox already uses. In general, though, cross-platform apps tend to be the worst in terms of implementing the right signals that Hazel would need to detect whether they are downloading stuff. You can try filing a bug with them to see if they'll do something about it this time but I wouldn't hold my breath.

The other issue is that there is a limitation in the unarchive action in that it cannot unarchive dmg files. So you need to make sure any rules to unarchive filter out dmgs. Also, the unarchive action "trashes" the original archive for you. If you do a trash action after an unarchive, you end up trashing the unpacked contents. Think of the unarchive action as transforming the archive to its uncompressed form.

I hope that clears up the problems you are seeing. With the Firefox issues, try and tweak the settings and also find the one method of downloading that generates the .part file consistently and only use that. Otherwise, there is no way for Hazel to detect it is downloading. Personally, I don't think it's acceptable for Firefox to have different ways of downloading things. It should be consistent or in the very least, predictable (when I talked to them, the developers couldn't not identify which cases triggered which download scheme).
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks for the response. To clarify, DownThemAll is the only way I do get consistent behavior. As it's a download manager it always downloads the file with a .dpart and only renames it to the proper extension until it's fully downloaded (so Hazel won't recognize it until it's done). Unfortunately, some websites don't allow files to be downloaded with DownThemAll.

So it sounds like Firefox can't be helped :( But I still wonder what's the best way to move a file only after it's opened. Like in the case of the VLC dmg, that the program itself downloaded. I'm going to try not using Date Added as that seems to be the problem since it uses the date the file first appears in the folder, and not necessarily the date the file is finished downloaded. I believe Date Last Modified would take the date of the file was last saved aka download was finished. Hopefully that would work, but any tips are welcome.

Thanks for the explanation on the unarchive action, that makes much more sense. I'll try just using unarchive (no delete) and filter out the dmgs.

Thanks!
SpiceLMF
 
Posts: 5
Joined: Sun Dec 14, 2008 7:54 pm

I've had luck with Firefox telling it to download to a specific folder and to not show the Downloads window but again, I've had reports of people with the same settings not getting the ".part" behavior. I'll investigate adding support for DownThemAll.

Depending on the program, date modified may or may not work. You'd have to experiment as some programs will download a file and use the modified date of the original file. That's usually more common with FTP-type programs.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks again. Thus far, Hazel seems to be behaving much better with Date Modified, but it's early days.

One tip to any users using DownThemAll. In the preferences, there's a tick box stating Set files time to last modified time (server) or time of queuing. By default this is turned on... it needs to be unticked. I was having trouble with my date modified rules until I realized DownThemAll was setting them to Dec 8th (obviously the last time that file was modified on the server I was downloading from).

Other than that it seems to be smooth sailing.
SpiceLMF
 
Posts: 5
Joined: Sun Dec 14, 2008 7:54 pm


Return to Support