Execute Series of Keystrokes Until the End of the Document

Others will have much more experience than I do with GUI processes, and with Pages in particular.

On the scripting side, I wonder if any of this looks relevant ?