I need to automatize a set of actions, calling different tools and answering to the popup windows.

At the moment, I use an AUTOIT macro that simulates key presses, but that's slow and can fail.

Is there an API to do that?