Can't Get MacOS Pages to Export PDF -- Ideas?

I have a script to edit a document in Pages and everything works fine until I want it to export the document as a PDF and it just... doesn't. I have it generate an ENTER keystroke and nothing happens.

Is this some sort of timing issue? Has anyone else encountered a program like Pages just not responding? And how would I solve this?

Hi @gmark, could you post your actual macro so we can take a look at it?

You can use AppleScript to export the front document in Pages as a PDF. Here's an example:

Download Macro(s): Test Export PDF from Pages.kmmacros (2.5 KB)

Macro-Image

Keyboard Maestro Export

Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.
System Information
  • macOS 10.15.7
  • Keyboard Maestro v10.2

For simplicity you need to specify the full path of the output (pdf) file in the red-coloured action so don't try to use the one I've used as an example just for testing on my system.