Help with format

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
koplersky
Posts: 13
Joined: 24 Oct 2012, 03:33

Help with format

Post by koplersky »

I'm trying to create a format to rename movies.
What I want is simple, it would create a folder with the movie name and move the media to that new folder. It would also create an info file with some information like the synopsis. That's because I keep downloading movies and sometimes I'm looking for something to watch and I can't remember what some movies are about, so having everything there would be nice.

I tried this format:

Code: Select all

/Users/<user>/Movies/{n} ({y})/{n}{if (ext != 'srt') {def a = new File('Info.txt'); for (item in {imdb}){a.write(item.toString())}}}
I get this warning:
"BindingException: "ext": Path to media file has not been set

If I remove the "ext" part, I get:
"access denied (java.io.FilePermission Info.txt write)"

I'm trying to run this from the format box, not as a separate script. Can I do this or do I need to run it as a script?

I'm on a Mac with OS X 10.9.2.

Thanks in advance.
User avatar
rednoah
The Source
Posts: 23936
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Help with format

Post by rednoah »

Sorry, the expressions are evaluated in a sandboxed environment where you don't have write access to files. I'd do a post-processing script that'll create those info files, can't do it in the format.

Though why are you not using my scripts? It's gonna be creating nfo files and fetching artwork:
http://www.filebot.net/forums/viewtopic ... 4&t=5#p205
:idea: Please read the FAQ and How to Request Help.
koplersky
Posts: 13
Joined: 24 Oct 2012, 03:33

Re: Help with format

Post by koplersky »

Yeah, why am I not using your scripts? :D
I don't know how I missed that, sorry.
I'm now using them with Delunge and Plex and they are working great.
Amazing job, thanks!
Post Reply