I save OCR'd pages to a designated folder as .txt files. The filenames are [date time] so that they stay in page order.
I am trying to achieve the following:
Read contents of each .txt file in order
Copy contents of each file to a clipboard/clipboards
Append all the clipboards in order
Write a single file containing all the text combined
Example (with file contents)
040422 1000.txt > even a stopped clock
040422 1001.txt > gives the right time
040422 1002.txt > twice a day
Desired output in a single .txt file: even a stopped clock gives the right time twice a day
There may be a different number of .txt files in the folder depending on the number of pages I've OCR'd, which is what makes it harder for me to set up.
Here's one approach, reading, in this example, from ~/sampleFolder (where ~ represents your home path) and writing out the combined contents of the sorted files to to ~/Desktop/combined.txt
but FWIW my personal experience is that in practice the Keyboard Maestro interface, or a typed scripting language, wastes less time on each task of this kind, and costs less up-front time to learn.