Fairly complicated, I'm having trouble figuring it out.

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

Moderator: Mr_Noodle

Somewhat of a Hazel noob here, I'm trying to figure out how to automate my torrent downloads.


Right now, I have 4 seperate rules.

One watches ~/Downloads for .torrents, adds them to Transmission and then deletes them from ~/Downloads and Growls me. This one works afaik.

http://cl.ly/3FEy






I then have two to delete .nfo and .m3u files from the downloaded folders. Here is the nfo one (replace nfo with m3u for the other). They don't work. :(

http://cl.ly/3FDZ




I have one more, the most important one, that I can't figure out at all. I want it to see a downloaded folder, go into it, take all the music files (always mp3s) and import them into my iTunes library, then delete the original mp3s as well as the folder they were downloaded in. It should then tell me it imported the folder to iTunes. I cannot figure this out. Can anyone help?



http://cl.ly/3Epg


Thank you in advance for any help you can offer. :)
kevinhoagland
 
Posts: 1
Joined: Sun Nov 14, 2010 11:27 pm

Read this post: viewtopic.php?f=4&t=470

It seems you are mixing the logic for two different things into the same rule. For instance, .nfo files probably aren't folders so you can descend into it like a folder. Neither can a folder be a music file. You should split the rules to process folders and files separately.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

kevinhoagland wrote:Somewhat of a Hazel noob here, I'm trying to figure out how to automate my torrent downloads.


Right now, I have 4 seperate rules.

One watches ~/Downloads for .torrents, adds them to Transmission and then deletes them from ~/Downloads and Growls me. This one works afaik.

http://cl.ly/3FEy






I then have two to delete .nfo and .m3u files from the downloaded folders. Here is the nfo one (replace nfo with m3u for the other). They don't work. :(

http://cl.ly/3FDZ




I have one more, the most important one, that I can't figure out at all. I want it to see a downloaded folder, go into it, take all the music files (always mp3s) and import them into my iTunes library, then delete the original mp3s as well as the folder they were downloaded in. It should then tell me it imported the folder to iTunes. I cannot figure this out. Can anyone help?



http://cl.ly/3Epg


Thank you in advance for any help you can offer. :)


Your trying to do too much in one rule. I always opt for more rules cause its easier in my mind and more flexible (at least until hazel is updated)

Not quite sure your setup so ill make a few assumptions. You download torrents to folder Downloads (u said this). Transmission downloads your files to another folder called Competed Downloads. Now the rules all run on the Completed Downloads Folder.

It sounds like all the downloads come as folders with contents in each folder so for example in the Completed Downloads folder you would have Folder A, Folder B, Folder C, etc each with MP3, NFO, and M3U files. So i would do this in order:

Go into Subfolders
If all conditions met:
Kind is Folder
Do the following:
Run rules on folder contents

Import MP3s to iTunes
If all conditions met:
Extension is MP3
Do the following:
Import into iTunes to playlist Library
Move file to folder Trash

Trash Remaining Contents [NOTE: I am assuming that basically after you import the MP3 you want to trash the entire folder (ie Folder A and all its remaining contents which would be NFOs and M3Us)
If all conditions met:
Extension is not MP3 [To ensure the MP3 action has occurred and then subsequently trashed]
Do the following:
Run Applescript embedded script
tell application "Finder"
set posix_parent_dir to POSIX path of (container of (item theFile) as text)

end tell
return {hazelSwitchFile:posix_parent_dir}

Move file to folder Trash

The applescript above brings you out of each folder and back up to the parent folders. Seems much easier to just trash the whole folder instead of the contents first and then the folder.

Let me know if this helps...
dhy8386
 
Posts: 94
Joined: Tue Nov 09, 2010 12:19 pm


Return to Support