Automate Dialogue box clicking? IDK how to word this question.

I am using a plugin called TAPython to export the entire contents of the map

While this works, it pops up a dialogue box that I need to click on to focus, then press “Export” on.

I’m trying to somehow automate this process or get rid of the dialogue box entirely so that I can automate this export process and remove any required human interaction.

Any help please?