Page 1 of 1

New to Hazel, confused about script

PostPosted: Tue Oct 28, 2014 10:36 pm
by countrymom
I'm testing out Hazel to see if it can help me prep files for Plex on my media server (Mac Mini running Maverick). I played with some earlier scripts to make sure Hazel's doing what I want it to, and that's good. I've read the FAQ on renaming TV shows and tried to recreate the script but it isn't working.

Here's the script I have:
If all conditions are met:
If Name Matches [(•show name).S(•season)E(•episode).(...)

Rename with pattern (•show name).S(•season)E(•episode)
Move to folder TV Shows
Sort into subfolder with pattern (•show name)>Season (•season)

I'm running it with a file named:
Downloads/Ready to Sort/Homeland.S04E03.WEBRip.x264-KYR.mp4

What I want to happen is for the above file to be renamed Homeland.S04E03.mp4 and put into the directory titled TV Shows/Homeland/Season 4. Could someone help me fix my script? I'd rather keep it all in Hazel - it's one of the reasons why I'm planning to purchase it. The example that is in the sticky on Tips & Tricks is old and uses other tools for renaming. I've googled it and have not been able to find anything useful.

I've read: viewtopic.php?p=3410#p3410
I tried reading: http://www.mactalk.com.au/content/organ ... pt-3-1024/ but it only shows in HTML and doesn't make sense
And: http://www.youtube.com/watch?v=_Gfjh2_AupU#t=94 but it just confused me more.

I tried file bot - purchased it off the App Store - and don't like it. I guess I can't automate the GUI version, and I have no desire to start to add things like Brew or to spend my days writing perl scripts again! I've got my automatic downloading down perfect - using TVshowsapp - but if I could get Hazel to finish the job, I'd be a very happy camper.

Then I just need to get my rar unpack script to work (but that's very few of my downloads), and create a script to delete old shows that I don't want to keep (should be easy).

PLEASE HELP!
Thanks!!

Re: New to Hazel, confused about script

PostPosted: Wed Oct 29, 2014 2:02 pm
by Mr_Noodle
Can you give details on how it isn't working?

Re: New to Hazel, confused about script

PostPosted: Wed Oct 29, 2014 8:44 pm
by countrymom
I put various files to be renamed in the directory, and nothing happens. I created a subfolder off of my downloads, moved the script to run off of the subfolder, wondering if that was the problem, but same (no) result.

Re: New to Hazel, confused about script

PostPosted: Thu Oct 30, 2014 10:02 am
by Mr_Noodle
I suggest trying the preview feature to try and isolate where things are going wrong. See the troubleshooting guide sticked at the top of this forum.

Re: New to Hazel, confused about script

PostPosted: Thu Oct 30, 2014 9:04 pm
by countrymom
Thanks for pointing out the preview and logging features. It is finding the file as expected (good). It still didn't do anything. Here's what the log shows (can't say as I understood it):
2014-10-30 21:00:53.126 hazelworker[5690] ###main load address: 0x10f278000
2014-10-30 21:00:53.127 hazelworker[5690] ###Noodle load address: 0x10f388000
2014-10-30 21:00:53.127 hazelworker[5690] ###CK load address: 0x10f350000
2014-10-30 21:00:53.271 hazelworker[5690] Processing folder To Be Sorted (forced)
2014-10-30 21:00:55.402 hazelworker[5690] Homeland.S04E04.HDTV.x264-LOL-1.mp4: Rule Sort and Rename TV Shows matched.
2014-10-30 21:00:55.403 hazelworker[5690] [b]Caught exception in rule evaluation of file Homeland.S04E04.HDTV.x264-LOL-1.mp4: [<ComNoodlesoft_HazelFileData 0x7f84b2e1f3c0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key hazelcustomtoken:Show Name.[/b]
2014-10-30 21:00:55.403 hazelworker[5690] ###main load address: 0x10f278000
2014-10-30 21:00:55.403 hazelworker[5690] ###Noodle load address: 0x10f388000
2014-10-30 21:00:55.403 hazelworker[5690] ###CK load address: 0x10f350000
2014-10-30 21:00:55.403 hazelworker[5690] (
0 CoreFoundation 0x00007fff89b6b25c __exceptionPreprocess + 172
1 libobjc.A.dylib 0x00007fff87ae8e75 objc_exception_throw + 43
2 CoreFoundation 0x00007fff89b6ae09 -[NSException raise] + 9
3 Foundation 0x00007fff907a57de -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 235
4 hazelworker 0x000000010f2a88f9 hazelworker + 198905
5 Foundation 0x00007fff906bcaf6 -[NSObject(NSKeyValueCoding) valueForKey:] + 381
6 hazelworker 0x000000010f2c8c3d hazelworker + 330813
7 hazelworker 0x000000010f2c8ca0 hazelworker + 330912
8 hazelworker 0x000000010f2ce172 hazelworker + 352626
9 hazelworker 0x000000010f2c6982 hazelworker + 321922
10 hazelworker 0x000000010f2cdcaf hazelworker + 351407
11 hazelworker 0x000000010f2c6bf9 hazelworker + 322553
12 hazelworker 0x000000010f2cddfa hazelworker + 351738
13 hazelworker 0x000000010f29b85b hazelworker + 145499
14 hazelworker 0x000000010f2b030b hazelworker + 230155
15 hazelworker 0x000000010f27ecd5 hazelworker + 27861
16 hazelworker 0x000000010f280979 hazelworker + 35193
17 hazelworker 0x000000010f282be1 hazelworker + 44001
18 libdyld.dylib 0x00007fff8941e5fd start + 1
19 ??? 0x0000000000000003 0x0 + 3
)
2014-10-30 21:00:55.408 hazelworker[5690] Done processing folder To Be Sorted

I'm not sure what that exception means?
Any insight would be welcome!

Re: New to Hazel, confused about script

PostPosted: Thu Oct 30, 2014 9:41 pm
by countrymom
I played with it a little, and now it's running but here's what I'm getting:

No renaming of the file
File gets put into a folder of the name of file > Season 04 > extended file name with an extra S04E04 on the end
Played around a bit more but this is the best I can get:

2014-10-30 21:38:46.837 hazelworker[5863] ###main load address: 0x10fd4f000
2014-10-30 21:38:46.837 hazelworker[5862] ###main load address: 0x10f2f5000
2014-10-30 21:38:46.839 hazelworker[5863] ###Noodle load address: 0x10fe5c000
2014-10-30 21:38:46.839 hazelworker[5863] ###CK load address: 0x10fe25000
2014-10-30 21:38:46.839 hazelworker[5862] ###Noodle load address: 0x10f403000
2014-10-30 21:38:46.839 hazelworker[5862] ###CK load address: 0x10f3c7000
2014-10-30 21:38:48.398 hazelworker[5862] Processing folder To Be Sorted
2014-10-30 21:38:48.398 hazelworker[5863] Processing folder Downloads
2014-10-30 21:38:51.037 hazelworker[5863] Done processing folder Downloads
2014-10-30 21:38:51.115 hazelworker[5862] Homeland.S04E04.HDTV.X264-LOL.MP4: Rule Sort and Rename TV Shows matched.
2014-10-30 21:38:51.117 hazelworker[5862] [File Event] File renamed: /Users/myid/Downloads/To Be Sorted/Homeland.S04E04.HDTV.X264-LOL.MP4 renamed to /Users/myid/Downloads/To Be Sorted/Homeland.S04E04.HDTV.X264-LOL.S04E04.MP4.
2014-10-30 21:38:51.119 hazelworker[5862] [File Event] File moved: Homeland.S04E04.HDTV.X264-LOL.S04E04.MP4 moved from folder /Users/myid/Downloads/To Be Sorted to folder /Users/myid/TV Shows.
2014-10-30 21:38:51.121 hazelworker[5862] [File Event] File moved into subfolder: /Users/myid/TV Shows/Homeland.S04E04.HDTV.X264-LOL.S04E04/Season 04/Homeland.S04E04.HDTV.X264-LOL.S04E04.MP4 sorted from folder /Users/myid/TV Shows to subfolder Homeland.S04E04.HDTV.X264-LOL.S04E04/Season 04.
2014-10-30 21:38:51.172 hazelworker[5864] ###main load address: 0x1086b6000
2014-10-30 21:38:51.173 hazelworker[5864] ###Noodle load address: 0x1087c7000
2014-10-30 21:38:51.173 hazelworker[5864] ###CK load address: 0x10878d000
2014-10-30 21:38:51.753 hazelworker[5864] Processing folder Downloads
2014-10-30 21:38:53.431 hazelworker[5862] Done processing folder To Be Sorted

Re: New to Hazel, confused about script

PostPosted: Fri Oct 31, 2014 11:57 am
by Mr_Noodle
At this point, it might be better if you email support. Export your rules and send those in.

Re: New to Hazel, confused about script

PostPosted: Sat Nov 01, 2014 1:05 am
by countrymom
I don't want to buy a license unless I'm sure this can do what I want, and I can't export unless I buy a license. Another suggestion?

Re: New to Hazel, confused about script

PostPosted: Sun Nov 02, 2014 11:57 pm
by countrymom
Please? I can't be the first person to do this entirely within Hazel!

Re: New to Hazel, confused about script

PostPosted: Mon Nov 03, 2014 4:49 pm
by Mr_Noodle
Send in screenshots then.

Re: New to Hazel, confused about script

PostPosted: Fri Nov 07, 2014 12:07 am
by countrymom

Re: New to Hazel, confused about script

PostPosted: Fri Nov 07, 2014 3:54 pm
by Mr_Noodle
I think one issue is that you are matching something as •name, but you are using name (the non-custom version of it). To clarify things you might want to call that custom attribute •show name and make sure to use that in the rename and sort patterns.