Variable PDF Virtual Stationary based on Text Script pulled from a .csv file

I have been using the invoice creation walkthrough to set up a Designer template for a job that we run every other week - http://help.objectiflune.com/en/walkthrough-samples/Invoice-Design/Resources/Files/Designer/Invoice_1-5/Walkthrough_Designer_Invoice_1-5.pdf

The job has multiple pdf backgrounds for the virtual stationary that would need to be changed dependent on text in a text script box that is inserted from a .csv file.

We are currently using Adobe InDesign for this, and having to manually switch the pdf backgrounds according to information provided in the .csv file (which is a mail list).

I have successfully set up the backgrounds, and text boxes for the address and the form number (which determines which pdf to use as the background), but this walkthrough doesn’t describe how to set up a script that finds information/text in a script text box to dynamically change the virtual stationary/pdf background it uses xml to find the appropriate image.

Does anyone have a script that would work for this situation or another suggestion to make this work?

Thanks!

Starting at version 1.8, it has been made available via script.

virtual stationary via Media.