Page 2 of 2

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 1:23 pm
by silvine
Great thanks for the info. I notice you said that you've automated your media to import into Plex. Can you give me some more tips to do the same? Plex is great but I find getting all the media appropriately named and moved is a chore which is why I bought Hazel. Also will that php script handle any movie file ie the example ones I mentioned above? I don't really know much about coding or scripts...

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 1:28 pm
by Gidgidonihah
Okay. Again, the PHP script only does anything with TV shows. I don't download any movies.
I use TED to get the shows I want.
Transmission opens the torrent files, and saves the show into the downloads folder.
Hazel sees the new file, runs the php script and it's moved into the appropriate folder.
All done. Everything automated. Nothing more to it.

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 2:53 pm
by silvine
Great I'll use the script for my TV shows so as I use Transmission as well. The other option looks less flexible.

I tried the code briefly last night but I must have done something wrong as it wouldn't work. When I am embedding the code into Hazel do I paste in from '<?php'?

Or do I copy and past from '$moveTo ='

In other words do I need the <?php tag?

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 2:57 pm
by Gidgidonihah
paste everything including the
Code: Select all
#!/usr/bin/php


I personally chose not to embed it and have hazel run the file (i.e. rename_script.php) instead.
That way i makes it easier to open and add shows to, etc.

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 3:00 pm
by silvine
So I open Script Edit, copy and paste everything from '#!/usr/bin/php' and click compile and save?

When I did this earlier it said something about an unexpected character. I'll retry when at my Mac later.

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 3:30 pm
by Gidgidonihah
No. You open text edit. Paste everything. Save as your_filename_here.php

PHP is not a compiled language.

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 5:57 pm
by silvine
I keep getting error processing shell script file on....

I went into the log and here's the error I found: Task: Task create for path '/Users/silvine67/Movies/Automatically Add TV Shows/Move TV Shows.php' failed: 22, "Invalid argument". Terminating temporary process

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 6:21 pm
by Gidgidonihah
Last time that happened to me it was because there was a space before the
Code: Select all
#!/usr/bin/php


that # has to be the first character in the file.

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 6:29 pm
by silvine
I checked that and it is. Here's what's happening now:


hazelfolderwatch[4475:203] *** NSTask: Task create for path '/Users/silvine67/Movies/Automatically Add TV Shows/Move TV Shows.php' failed: 22, "Invalid argument". Terminating temporary process.

hazelfolderwatch[4474] [Error] Shell script failed: Error processing shell script /Users/silvine67/Movies/Automatically Add TV Shows/Move TV Shows.php on file /Users/silvine67/Movies/Automatically Add TV Shows/24 - S08E01.avi.

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 7:27 pm
by Gidgidonihah
Not sure about that one. I'm guessing the parameters aren't being passed into the script?
I don't know what to tell ya.

Re: Series renaming script

PostPosted: Tue Feb 09, 2010 7:34 pm
by silvine
Okay thanks for the help anyway.

Re: Series renaming script

PostPosted: Thu Feb 11, 2010 1:53 pm
by Mr_Noodle
If the script is embedded, you want to put "/usr/bin/php" as the shell. That comment line is unnecessary in the body of the script. BTW, where is the script that you guys are talking about?

Re: Series renaming script

PostPosted: Thu Feb 11, 2010 2:40 pm
by sjk
Mr_Noodle wrote:BTW, where is the script that you guys are talking about?

In the first post of this thread?

Re: Series renaming script

PostPosted: Tue Feb 16, 2010 4:13 pm
by Mr_Noodle
Ack, sorry. Didn't see that this thread was multiple pages. Ignore me.