Open Videos, Delete Everything Else

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

Moderator: Mr_Noodle

Open Videos, Delete Everything Else Mon Mar 01, 2010 1:31 am • by AustinMatherne
I've gotten the hang of how to use hazel for basic file and folder management, but this one is a little above my head. Any help is greatly appreciated.

Right now, I'm using hazel to open any movie file found in "/Users/AustinMatherne/UseNet/Complete/TV" and its subfolders in an application called videodrive. Videodrive converts the videos and than copies the converted videos into itunes, and after its done it deletes the original movie file.

How can I get hazel to find any movie files (mostly in subfolders), open them with videodrive, then delete any other files that aren't movie files (aka were not opened with videodrive), and than after videodrive deletes the video files, also trash the now empty folders.

Thanks,
~ Austin
AustinMatherne
 
Posts: 6
Joined: Wed Jan 27, 2010 12:41 am
Location: Stamford, Connecticut, USA

Re: Open Videos, Delete Everything Else Tue Mar 02, 2010 4:32 pm • by Mr_Noodle
Make sure to check the sticky article about subfolders. After reading that, you should at least be able to set up rules to scour for movie files. From there, you can then add a rule to match the reverse of the rule to match movies to then throw away those files. Finally, you can add a rule to match folders with a size of 0 and trash those.

I suggest doing this on some test files as until you understand what's going on, it's very possible that you will end up throwing away the wrong files. Post here if you need more help.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I can't quite figure this one out. I exported the rules so maybe you can help.

http://files.me.com/austinmatherne/iq1ijx

To me this should work, but if I copy a folder with two files "test.mkv" and "test.txt" hazel deletes everything, including the video and folder. It also doesn't open the video with videodrive. Any ideas?

Thanks,
~ Austin
AustinMatherne
 
Posts: 6
Joined: Wed Jan 27, 2010 12:41 am
Location: Stamford, Connecticut, USA

Re: Open Videos, Delete Everything Else Wed Mar 03, 2010 1:31 pm • by Mr_Noodle
First off, get acquainted with the preview function as this will allow you to check your rule logic.

Now, I believe the problem is that "Delete Non Movie Files" is matching folders (remember, folders aren't movies), so those get nuked along with any other non-movie files. If the movie files are in a folder, they get nuked with the folder. If you only want to throw away non-movie files in subfolders, you can play with the "Subfolder depth" attribute to have it only apply to folders below the top level. Or you can add a condition to exempt folders. Or you can stick that rule at the end such that only files not processed by the previous rules would match.

Try the above and post back here with the results.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks, I never seem to remember the preview rules function exists.

I got it to work by adding "Kind is not folder" to the delete non movie files rule, but, it doesn't delete the folder that is then empty until I add something new to the above folder. I thought this had to do with videodrive not deleting the video until after it was finished converting, so I replaced the open with videodrive rule with a move movie file to another folder rule (which has a rule to open movies with videodrive). This still doesn't delete the now empty folder.

If I'm looking at this right (with the preview function) the reason the folder doesn't get deleted until something is added to the main folder, is because the folder already matched the rule to check subfolders and it only matches the first rule it finds. So is there anyway to get it to match two rules?

http://files.me.com/austinmatherne/yveymg

Thanks,
~ Austin
AustinMatherne
 
Posts: 6
Joined: Wed Jan 27, 2010 12:41 am
Location: Stamford, Connecticut, USA

Re: Open Videos, Delete Everything Else Fri Mar 05, 2010 3:10 pm • by Mr_Noodle
There might be a delay after you delete all the files out of a folder since it would require another pass to see that the folder is empty. Also, if that folder has an empty folder, it will percolate up so it may take even more passes. You should check the logs to see what is actually happening though. Feel free to post relevant fragments here if you need help interpreting them.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support

cron