How about this?
app.preferences.rulerUnits = Units.PIXELS; var up = 400; var down = 400; var right = 1200; var doc = app.activeDocument; var x = (doc.selection.bounds+doc.selection.bounds)/2; var y = (doc.selection.bounds+doc.selection.bounds)/2; doc.selection.select([[x, y-up],[x+right, y-up],[x+right, y+down],[x, y+down]], SelectionType.REPLACE);
Hello JJ-- yes, of course the original scans are about 1200x800 at 4800 dpi-- I've downsized for the example image.
The the approch I wrote in your other append may be the way to go.
I think you would also need to design some interface to use when you script it and the strip would need to be aligned to the vertical well first. To pass some location information as to where the sprocket hole or holes you want to process and create a documents with its frame's content. A color sampler for example you can set up to ten of these before running your script. Your script could use the magic wand on each of the points one at a time find the bounds of the a hole then set a selection relative to the holes bounds to select the frame rather then the hole and create a document with its content save it out and then move on to the next hole marked by a color sampler. I think you may find scripting something like that may work if all the film strips are from the same camera. I think there may be some differences in hole location if the strips are not all from the same camera.
Get the hole's bounds calculate the frame's bounds then select the frame's content. The file must be vertical
Why do not you use it instead
Scripts with ScriptingListener
LAB color = 100
Then use the selections coordinates to work?
What color range would select a single frame or socket hole so you can get its bounds?