Hey shadeoner,
i'm no developer, but i needed to create something like timelapse slices, because i wanted to put the timelapse i created into one picture (example below). At first i had no idea how, but with your code i was able to make it. Maybe my code will help you to create also the "slit scan" you wanted, if you haven't already . It's also my next goal, at least to try it. Thank you for inspiration.
app.bringToFront();
var inputFolder = Folder.selectDialog("Locate the folder containing the image sequence:");
var fileList = inputFolder.getFiles(/\.(nef|cr2|crw|dcs|raf|arw|orf|dng|jpg|tif|psd| eps|png|bmp)$/i);
//selecting image sequence
var strtRulerUnits = app.preferences.rulerUnits;
app.preferences.rulerUnits = Units.PIXELS;
app.open( fileList[0] )
app.activeDocument = app.documents[0];
var width = app.documents[0].width;
var height = app.documents[0].height;
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
//getting the dimensions
var docRef = app.documents.add(width, height, 72, null, NewDocumentMode.RGB, DocumentFill.WHITE);
app.preferences.rulerUnits = strtRulerUnits;
//creating a new document
var thickness = (width / fileList.length);
//calculating the thickness of the stripes
alert( "Folder contains "+ fileList.length + " files, " + height + " x " + width + " each. The slices will be " + thickness + " thick." );
for( var i = 0; i < fileList.length; i++){
app.open( fileList[i] );
selRegion = Array(
Array((i*thickness), 0),
Array((thickness*i)+thickness+1, 0),
Array((thickness*i)+thickness+1, height),
Array((i*thickness), height));
app.activeDocument = app.documents[1];
app.activeDocument.selection.select(selRegion);
app.activeDocument.selection.copy();
app.activeDocument.selection.clear;
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
app.activeDocument = app.documents[0];
app.activeDocument.selection.select(selRegion);
app.activeDocument.paste();
app.activeDocument.selection.clear;
//app.activeDocument.flatten(); //flattening image layers
}
docRef = null;