Detect vision or perspective

I don’t think that you will be able to have access to vision client scripting functions from a script that is a gateway event, but if you put the script into a project library, you could detect which functions are available to you like this:

if hasattr(system, 'perspective'):
     system.perspective.openPopup(...)
elif hasattr(system, 'gui'):
     system.gui.errorBox(...)

Then inside of the if blocks you could call the popup or errorbox functions since you know that one or the other exists at that point. Would that work?
On second thought, I think this will give you the same information as what I suggested already…

1 Like