Syntax: #loop {from,to} {commands}
The #loop command will run a command in a loop, and put the current loop index into the %0 variable. You can use this variable in commands to be executed in the loop.
Example:
#loop {2,5} {get all %0.chest}
Will get all from 2nd, 3rd, 4th and 5th chest.