OS X Automator or Groovy?

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
clarkdv
Posts: 5
Joined: 19 Feb 2012, 17:33

OS X Automator or Groovy?

Post by clarkdv » 19 Feb 2012, 17:51

I'm a novice at scripting, I know a little but I'm not fluent in it. I want to automate a watched folder to rename tv episodes using tvrage. I tried doing it by having Automator run a bash script using some examples from this forum but had no success.

I used Terminal to cd to the filebot app's internal folder, I used Terminal to install the install.sh file by doing "sh install.sh"

I have Automator triggering the filebot workflow but it fails and the Console reports "NSLocalizedFailureReason=-: filebot: command not found (127)"

My question is which is easiest? Trying to do this via Automator or should I install Groovy and do it that way? If OS X and Automator are capable of doing it I'd rather not install something else, you know? But if Groovy really is way easier and better than Automator then I'll go that route.

Thanks!

Patrick

User avatar
rednoah
The Source
Posts: 16278
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: OS X Automator or Groovy?

Post by rednoah » 19 Feb 2012, 18:21

Looks like the filebot cmd isn't setup properly. Just read up on how to add things to the PATH so your console will find the filebot executable. Or try using the absolute path to filebot[.sh]

FYI FileBot packages a complete Groovy runtime so there is no reason what-so-ever in additionally "installing" Groovy. Also Groovy scripting Is currently broken for Java 6 (which is default on Mac) anyway. So you should definitely go with Automator. ;)
:idea: Please read the FAQ and How to Request Help.

clarkdv
Posts: 5
Joined: 19 Feb 2012, 17:33

Re: OS X Automator or Groovy?

Post by clarkdv » 19 Feb 2012, 23:45

My workflow in Automator has this script "filebot -rename /Volumes/Data HD/Video/Daily Colbert --db thetvdb" I want it to simply rename all the files in that folder, no moving of files needed.

Because I get the "filebot: command not found (127)" error in Console, and like you said looks like the filbert cmd isn't setup properly, I don't know where to go from here.

I don't understand how to add things to the PATH so console will find the filebot executable. Or try using the absolute path to filebot[.sh]

Can you advise me on how to do that?

Thanks!

User avatar
rednoah
The Source
Posts: 16278
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: OS X Automator or Groovy?

Post by rednoah » 20 Feb 2012, 01:28

I'm not on mac, try something like /path/to/filebot/app/MacOS/filebot -rename...

The problem is that OSX can't find the filebot executable/script. If you google for "add to path" or something like that there'll be plenty help telling you how it works on mac (I only know windows). Install.sh is just linking filebot.sh into /bin where all the others executables are.

Maybe u need to run sudo ./install.sh, cause it needs admin priviledges to create a link in /bin.
:idea: Please read the FAQ and How to Request Help.

clarkdv
Posts: 5
Joined: 19 Feb 2012, 17:33

Re: OS X Automator or Groovy?

Post by clarkdv » 20 Feb 2012, 04:42

Progress but still failed!

After looking in /usr/bin and seeing that there was, indeed, a link there to filebot, I then added "/usr/bin/" to the front of the script that Automator runs, so that it now looks like this "/usr/bin/filebot -rename /Volumes/Data HD/Video/Daily Colbert --db thetvdb"

Now when it runs the Console error is: "NSLocalizedFailureReason=-: /usr/bin/filebot: Too many levels of symbolic links (126)"

Thoughts?

User avatar
rednoah
The Source
Posts: 16278
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: OS X Automator or Groovy?

Post by rednoah » 20 Feb 2012, 05:10

No clue. Just try using the absolute path of the executable.

Now on my machine that would be:

Code: Select all

"C:/Program Files/FileBot/filebot.cmd"
On Mac something like this I guess:

Code: Select all

/my/apps/FileBot.app/Contents/MacOS/filebot
:idea: Please read the FAQ and How to Request Help.

clarkdv
Posts: 5
Joined: 19 Feb 2012, 17:33

Re: OS X Automator or Groovy?

Post by clarkdv » 20 Feb 2012, 05:14

OK, I did that, my workflow script now looks like this "/Applications/Filebot.app/Contents/MacOS/filebot -rename /Volumes/DataHD/Video/DailyColbert --db thetvdb" and it seems to be running.

It didn't like the spaces in my hard drive name or my folder name at first so I changed that.

Now I think the error I'm getting is a Filebot error. It's this: "NSLocalizedFailureReason=Exception: Unable to auto-select query:"

Thoughts?

User avatar
rednoah
The Source
Posts: 16278
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: OS X Automator or Groovy?

Post by rednoah » 20 Feb 2012, 05:20

Yep, that's FileBot unable to make sense of the input it got. It fails to auto-detect the series name. You can fix that by adding --q "Daily Colbert" parameter. You should at least get one step further with this. If later FileBot still says something about not being able to match files with episode information, try adding -non-strict option.

FYI with 2.4 there are some limitations with date-based shows:
@see http://filebot.sourceforge.net/forums/v ... &t=59#p331
:idea: Please read the FAQ and How to Request Help.

clarkdv
Posts: 5
Joined: 19 Feb 2012, 17:33

Re: OS X Automator or Groovy?

Post by clarkdv » 20 Feb 2012, 05:51

AHA!! Success!!!!

The winning script as a Automator workflow was:

Code: Select all

/Applications/Filebot.app/Contents/MacOS/filebot -rename /Volumes/DataHD/Video/DailyShow --q "The Daily Show" --db tvrage
Thank You Thank You Thank You!!

Post Reply