Detect if a script is executing in vision or perspective?

On a gateway with vision and perspective, I would like to know in a script if it is executing in vision context or perspective context ?

If you just need to distinguish Perspective from Vision, I’d use com.inductiveautomation.ignition.common.model.ApplicationScope#getGlobalScope
e.g.

from com.inductiveautomation.ignition.common.model import ApplicationScope
isVision = ApplicationScope.isClient(ApplicationScope.getGlobalScope())
3 Likes

Thanks a lot :+1:
Exactly what I was looking for.