Cumulative Photo Text Taking Macro (v11.0.1)

Have you ever wanted to OCR a document using your iOS camera or iPad camera? There's a lot of steps you have to take, which are repetitive and dull, in order to get all the text to your Mac. I've created a KM macro that works together with an iOS/iPadOS "Shortcut" that solves the problem, and automatically adds the text to a KM variable as you take multiple photos in a row.

The KM half of this puzzle was easy. The hard part was the iOS side. The two problems on the iOS side were that (a) it wasn't automatically sending photos to the iCloud for the Mac to process, and (b) it wasn't clear how to get photos to automatically go into a folder that Photos could sync with the Mac.

First off, let's look at the KM macro. It's simple. It triggers on a new photo being detected in an iCloud folder. It reads the text of the photo using the fabulous macOS OCR, then adds a Return, then saves that text into a variable for your use later. That was the easy half.

Cumulative Photo Text Taking.kmmacros (2.6 KB)

The hard part was getting an iOS or iPadOS macro to let you take photos and then upload the images to iCloud which would allow the Mac (and KM) to see it. I don't think this is really a documented function in Shortcuts. I had to find a trick to make it work. Without my tricks, this method won't work, although due to issues like device speed and Internet speed, I can't guarantee it will work on your devices. I'm curious to know if you test it and find that it works... or doesn't.

Basically this is an unending loop (well, it's not unending, but Shortcuts doesn't seem to have an unending loop, so I settled for 200 photos.) This macro, when run, will let you take a photo, (it then offers a confirmation) save it into an iCloud folder which I have named "Camera", and perform three more statements that I discovered were able to force the device to upload to iCloud so that the Mac could see it and download the photos. If I remove these three statements, the iCloud won't sync. Maybe for you those three statements won't all be necessary. Or maybe you will require additional pausing. I don't know. I don't really understand when iCloud syncs, or how to force it, but this trick worked for me.

When you are finished taking photos, all the text will be stored in the variable "AllPhotoStrings." You can manually use this text later to paste it into your Pages document, or whatever.

If I'm creating an overly complex solution for a simpler problem, please tell me. Even if there's an easier solution, I enjoyed coming up with this one. There might be an app on the Apple App store that helps with this.