Getting "The token '&&' is not a valid statement separator in this version." error.
Posted: 27 Feb 2017, 00:14
I recently updated to the windows app version of Filebot, which I'm calling from a batch script. Although I'm now getting an error due to the "&&" in my--def exec string. This was working with the previous non-windows app version of Filebot. Is there another "token" I need to be using?
The error:
And my --def exec string. It sets a few variables, then calls two batch scripts; The first sends a Pushbullet alert, and the second creates a list of file paths which are checked for duplicates later in my script.
Thanks for any help.
The error:
Code: Select all
At line:1 char:25
+ SET name=Game of Thrones&& SET season=Season 2&& SET episode=S02E01&& ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:47
+ SET name=Game of Thrones&& SET season=Season 2&& SET episode=S02E01&& ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:68
+ ... =Game of Thrones&& SET season=Season 2&& SET episode=S02E01&& SET tit ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:100
+ ... ason 2&& SET episode=S02E01&& SET title=The North Remembers&& SET yea ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:116
+ ... sode=S02E01&& SET title=The North Remembers&& SET year=2011&& SET typ ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:135
+ ... itle=The North Remembers&& SET year=2011&& SET type=Episode&& SET fil ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:184
+ ... pe=Episode&& SET filepath=D:/Media/TV Shows/Game of Thrones&& CALL C: ...
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:301
+ ... xxxxxxxxxxxxxxxxxxxxxxx C:\Windows\System32\pushbullet.exe && CALL C: ...
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
Code: Select all
--def exec="SET name={n.replaceAll(/[:|]/, \" - \")}&& SET season={episode.special ? \"Special\" : \"Season \"+s}&& SET episode={episode.special ? \"S00E\"+special.pad(2) : s00e00}&& SET title={t}&& SET year={y}&& SET type={type}&& SET filepath={type=Episode ? [%disks%].collect{ (it+\"/Media/TV Shows/\"+n.replaceAll(/[:|]/, \" - \")) as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last() : \"\"}{type=Movie ? [%disks%].collect{ (it+\"/Media/\"+{fn =~ /3D/ ? \"3D Movies\" : \"Movies\"}+\"/\"+n.replaceAll(/[:|]/, \" - \")+\" \"+\"(\"+y+\")\"+{fn =~ /3D/ ? \" [3D]\" : \"\"}) as File }.sort{ a, b -> a.exists() <=> b.exists() ?: a.diskSpace <=> b.diskSpace }.last() : \"\"}&& CALL pushbulletalert.bat %name% %season% %episode% %title% %year% %type% %pushbulletapikey% %pushbulletvar% && CALL writeduplicatecheckpaths.bat %season% %type% %filepath% %tempvarlocation%"