Is this the same as your Scripting problem with dialog box thread or a different problem/question?
If it's different, please give more detail of what is failing and where, and of what you've tried so far. With scripting, it usually makes sense to break things down into the most simple case you can which still triggers the behaviour.
The act of simplifying things often reveals where the mistake is, if it's in the code, and helps us to focus on the real problem while not being bogged down by unimportant details, whether it's in the script code or on the Opus or Windows sides of things.