Since the 'Extract text with OCR' action doesn't work on rotated images, I am utilizing a PowerShell script to rotate the .png after the OCR fails to extract my desired text, however it seems the OCR scan is leaving the file locked for a substantial length of time. I have to utilize another script in an increasingly delayed loop to test if the file is locked. The locked duration seems to increase drastically with each of my loops.
Is there anyway around this, or perhaps a way to kill the process that is locking the file after each loop?
This flow is reading OCR scans of images from PDF files in order to disperse them into proper folders.