I don't know code which is really embarrassing for simple tasks like this one. All I'm trying to do is to make a Quick Action in Automator for this:
- take a screenshot based on two fixed points
- click a "next" button in an app (in my case; Kindle for Mac)
- Repeat X times
Caveat (if relevant): my screenshots capture in JPG format (not PNG).
Though my "watch me do" was not successful, the recording process did capture me depressing the app's page-advance button which I see is called "Next Page."
A workaround would be to use CliClick to push the advance button, if which I already have installed if "Next Page" might not work for whatever reason. The repeating screenshot would be a pre-defined pair of coordinates based on upper-left and lower-right (which I can get via CMD+SHIFT+4).
Thanks so much in advance! Any method to pull this off in Automator is fine by me. Cheers!
EDIT 1: added code for @ankii below here EDIT 2: deleted what was added in EDIT 1 (no longer relevant)