I need help making a script. Here's what I need it to do. I need it to rename the movie file and folder in "C:\dtemp\movies" and then move the movie folder to "C:\transfer". Now I want to use this string to rename the files :
Code: Select all
{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} ({y}){' CD'+pi}
A Nightmare on Elm Street (1984) ==> Renames to ==> Nightmare on Elm street, A (1984)
I have created a batch file for SABnzbd to run after downloading a movie with the following code:
Code: Select all
"C:\Program Files\Filebot\filebot.exe" -rename "C:\dtemp\movies" --format "{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} ({y})/{n.replaceFirst(/^(?i)(The|A|An)\s(.+)/, /$2, $1/)} ({y}){' CD'+pi}" --output "C:\transfer"
So I end up with C:\transfer\Nightmare on Elm Street, A (1984)\Nightmare on Elm Street, A (1984)\Nightmare on Elm Street, A (1984).mkv
Instead of C:\transfer\Nightmare on Elm Street, A (1984)\Nightmare on Elm Street, A (1984).mkv
Any suggestions on how to fix this?