Script for auto-adjusting Levels, possible or not?
One of the things I am currently using Photoshop for is editing my digitised black and white negatives. I digitise them with my Sony A7ii camera and not a dedicated scanner, which results in low contrast RAW images. I've all ready set up an action to convert the negative raw files to positive tiff files, but I still need to edit the levels for every single image. That got me thinking, but before getting in to learning how to script, I am just going to ask if this is possible at all... It would speed up my workflow tremendously.
Is there a way that a script can be written that automatically adjusts the levels black and white points to where the curve starts? So the black point will move to the first black on the curve, and the white move to the first white on the curve?
See the image to clarify what I mean.

Thanks for anyone who is able to answer this question or help me in any way!
