by jungybrand » Thu Nov 29, 2012 4:51 am
I don't know if this will help anyone, but I ran into the same error of being able to make this work in terminal directly but seeing a failure when running through Hazel. I am not a programmer but these instructions were really detailed from the OP so I thought I'd give this all a go. Many thanks to him for taking the time to put this together in a way that even a newbie can follow.
My config.json file lives on an external hard drive named Central Media. This is also where I keep all of my episode files. I noticed that when I dragged the .json file into terminal it created the path as
/Volumes/Central\ Media/mytvnamerconfig.js
rather than what I expected to be
/Volumes/Central Media/mytvnamerconfig.json
When I first set up my Hazel rule and modified the OP embedded script, I entered it as
/usr/local/bin/tvnamer --config=/Volumes/Central Media/mytvnamerconfig.json and this failed. After comparing the embedded script in Hazel to the terminal lines, I changed my rule to read
/usr/local/bin/tvnamer --config=/Volumes/Central\ Media/mytvnamerconfig.json and the episodes moved perfectly!
I guess that the space in the name of the Volume doesn't work well. If you are seeing the terminal work properly but the Hazel script failing, do you have a space in the volume name or somewhere in the path?