This is a simple script that combines multiple paired files into single multi-layered psd files in the same folder.
A little history: I beat my head against the wall for quite a while trying to make this script using the file-glob and batch functions, but could never get it to work due to ubuntu's random file manager which made it impossible to correctly pair my numbered files. Anyway, I created this because I had a couple thousand paired images each numbered and in two different file formats (jpg and tif) that I needed to put into single psd files. For example, I had background images and colormaps that overlay the backgrounds (1001.jpg was one background and 1001.tif was the colormap, then 1002 was a different background and colormap, etc.) and I wanted to put them into the same file so I could edit them together easily at a later time, hence the creation of a psd with the bottom layer the jpg and the top layer the tif.
I imagine anyone can modify this script to take any different file formats easily. It would take a little more time to edit this script to take the pairs from different folders or use a different naming scheme, but hopefully this could give whoever a start.
I am by no means an actual programmer or have much experience with scheme or any programming language, so this script may not be the best way of doing this.