How to move 256 random files into folder

Hi,

I've searched and cannot seem to figure how to make Directory Opus read from a folder of maybe 1000 mp3's, and create enough folders which contain 255 random songs/files in each folder.

I have an older car stereo that will only allow folders with 256 music files in each folder up to 256 folders on a USB stick.

Does anyone have a script I can learn from or change to make this mundane task a little easier?

Thanks

This script can select random files (if I remember correctly, the random option was added for a car mp3 player, as it happens):

There's also this, which is an earlier version of the same thing, before it was combined into a command that does lots of other things. May be useful if you just want to look at how it's done: