You're might want to investigate AppleScript for UI interaction.
I use UI Browser, which makes this kind of thing much easier.
That said, you may also be able to automate a series of simulated keypresses to interact with the various buttons and dropdowns:
Tab
to iterate focus through each element, Space
to click it, simulated typing or up/down arrows to select items in the dropdowns, Enter
to confirm selection thereof, etc.