Series renaming script

From your noodle to other noodles. Talk about ways to get the most from Hazel. Even exchange recipes for the cool rules you've thought up. DO NOT POST YOUR QUESTIONS HERE.

Moderators: Mr_Noodle, Moderators

Re: Series renaming script 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...
silvine
 
Posts: 17
Joined: Mon Feb 08, 2010 3:30 pm

Re: Series renaming script 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.
Gidgidonihah
 
Posts: 19
Joined: Mon Jul 28, 2008 6:18 pm

Re: Series renaming script 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?
Last edited by silvine on Tue Feb 09, 2010 2:58 pm, edited 1 time in total.
silvine
 
Posts: 17
Joined: Mon Feb 08, 2010 3:30 pm

Re: Series renaming script 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.
Gidgidonihah
 
Posts: 19
Joined: Mon Jul 28, 2008 6:18 pm

Re: Series renaming script 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.
silvine
 
Posts: 17
Joined: Mon Feb 08, 2010 3:30 pm

Re: Series renaming script 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.
Gidgidonihah
 
Posts: 19
Joined: Mon Jul 28, 2008 6:18 pm

Re: Series renaming script 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
Last edited by silvine on Tue Feb 09, 2010 6:22 pm, edited 1 time in total.
silvine
 
Posts: 17
Joined: Mon Feb 08, 2010 3:30 pm

Re: Series renaming script 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.
Gidgidonihah
 
Posts: 19
Joined: Mon Jul 28, 2008 6:18 pm

Re: Series renaming script 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.
silvine
 
Posts: 17
Joined: Mon Feb 08, 2010 3:30 pm

Re: Series renaming script 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.
Gidgidonihah
 
Posts: 19
Joined: Mon Jul 28, 2008 6:18 pm

Re: Series renaming script Tue Feb 09, 2010 7:34 pm • by silvine
Okay thanks for the help anyway.
silvine
 
Posts: 17
Joined: Mon Feb 08, 2010 3:30 pm

Re: Series renaming script 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?
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Series renaming script 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?
sjk
 
Posts: 332
Joined: Thu Aug 02, 2007 5:43 pm
Location: Eugene

Re: Series renaming script Tue Feb 16, 2010 4:13 pm • by Mr_Noodle
Ack, sorry. Didn't see that this thread was multiple pages. Ignore me.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Previous

Return to Tips & Tricks - DO NOT POST QUESTIONS

cron