WSC Referring to DOPUS object

Linking the FAQ for context:


I'm assuming we're talking about WSC script libraries when called from Opus, and not about trying to use Opus objects from scripts run outside of Opus.

I've never used WSC script libraries myself, but if you can't use the Opus objects directly, I'd expect it to still work if you pass the objects in from the main script which loaded the library.

You could pass the DOpus object to each function call, or have an "Init" function inside the WSC library that you call just after creating it and which stores the DOpus object in a global variable, after which the rest of the code in the library can refer to that variable. If you call the variable "DOpus" then the rest of the code will be the same as if it was directly in the main script/button/hotkey.