Translator question: how to automate downloads via query forms

I have prepared a translator for one part of the Lexis service. It is working well enough, and I would now like to extend it to download the full text of articles as attachments.

To download a document, the user clicks on a normal (GET) link, which calls up a form with some options (Word, pdf, etc.). The users selects her options and clicks on the form button (POST). This returns a third page with a link. The user clicks on it (GET) to complete the download.

It looks like the link from the third page is what I need to be sending through in the Zotero.Item object to set up an attachment. I'm puzzled over how to grab it, though. With Zotero.Utilities.HTTP.doGet for the first button, and Zotero.Utilities.HTTP.doPost for the second, I would be able to get the page with the link; but both of those are asynchronous, and I can't see any way of passing the string back to the original context that is processing the Item.

This would seem to call for a connection that is synchronous within the context of the top-level doGet (the one that creates and processes the Item), something without a handler that can return the page straight to a variable?

(There is one further wrinkle to mention; the intermediate form with the POST button delivers a please-wait page that refreshes to reveal the result page with the link.)

This must be possible somehow, and probably has a one-word answer. What am I missing?
This discussion has been closed.