I'm hoping this is in the correct part of the forum.
I've no real experience of writing batch files, so please be gentle.
It's really a query about selecting files to copy, from one download folder, to another folder; they are photos have been created in a camera whilst "Focus Stacking"
Essentially, on some Olympus cameras, and maybe others, there is a facility where one is able to take multiple images, each at a slightly different focus point, to give a greater depth of field.
These can then be stacked in external software, lets say 100 images, and the resultant photo will have a much greater depth of field.
This is simple enough and you just select the 100 images you need, and stack in "Helicon Focus" or a similar package.
On Olympus, there is also the facility to do this in camera, which is where my query begins.
On one shutter press, the camera takes 15 images, writes them to the card, as *.jpg and a matching *.orf
The .orf is the Olympus proprietary raw file.
Camera then processes the 15 pairs of images, and creates a single .jpg, with no associated .orf, so for the one shutter press, there are 31 files in total; 15 pairs + one stacked jpg.
I would like to write a batch file, to copy all of these orphan stacked .jpg files to another folder, as successful stacks.
The problem is, that if one moves the camera, or say the insect moves, the stacking attempt fails; the camera tells you this, still writes 15x *.jpg + 15x *.orf, but no extra stacked orphan jpg.
For this reason I can't simply copy every 16th *.jpg, as it will become out of sequence following a failed "in Camera" stacking.
The camera generates file numbers which increment +1 for each exposure e.g. (P8280101.jpg + P8280101.orf) through to 15 more (P8280116.jpg + P8280116.orf) and I want to copy the next successful stacked file P8280117.jpg but only if if it has worked successfully, and thus there is no P8280117.orf; otherwise P8280117.* just becomes the start of the next matched pair of 15 shots.
I came across a batch file to copy every Nth jpg, which I've modified, and works fine, but only of any use if there are no processing errors, as it then gets out of step.
Sorry, I can't get rid of the smileys in the above, so for each please read : p but without the space between the colon and the p.
Effectively I need some sort of line which states that "IF" there is no *.orf to match a given *.jpg then copy "that".jpg to a different folder, and then move on to the next; unfortunately I've no idea how to achieve that, and my last experience of programming in Basic was 40+ years ago.
Any kind soul with any useful ideas please?
Many Thanks
Bill
Attached Files
Edited by peak4, 28 August 2022 - 03:09 PM.