Page 1 of 1

moving and if statements

Posted: 26 Jan 2019, 13:59
by mrtec
I have already been looking around and getting more confused.

I use AMC script and would like to transfer files to different folders depending on their Name existing in said folder.


send series X in folder X: ( only if there is already a folder named X otherwise move it to folder Z?

Im sure im stuck in a very basic one but cant get to understand how

Re: moving and if statements

Posted: 26 Jan 2019, 14:37
by rednoah
There's an example for moving files onto the drive with the most space in the examples:
viewtopic.php?t=2

The code is tricky, but you can just copy and paste it, mostly.


e.g. this should do:

Code: Select all

{['X:', 'Z:'].collect{ it / plex.dir }.sort{ a, b -> a.exists() <=> b.exists() }.last()}/{plex.name}