Trying to automate with Lua the exporting process but am only able to open exporting

I am trying to automate testing with ardour with things like adding tracks. Recording for a certain amount of time. Then trying to export individual tracks and save them with certain names. I am only able to open the exporting dialog using the lua command

Editor:stem_export ()

Is there anyways I can export an individual track without the need to open the dialog or fill in the dialog with lua so the user only needs to click export?

Thanks for any help