I have a folder called "tokens". In this folder, I have several other folders, called things like "guard", "noble", "assassin", etc. In those folders are image files with varying names and file formats.
I would like to run through the all the folders and files in "tokens", and rename each file to be whatever directory it is in with a number appended to it. So, a file in the "guard" folder would be named "guard0001.jpg", and the next would be "guard0002.png", for instance.