Page 1 of 1

Help with format

Posted: 23 Mar 2014, 05:46
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.

Re: Help with format

Posted: 23 Mar 2014, 11:16
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

Re: Help with format

Posted: 26 Mar 2014, 03:05
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!