# Get current scope in scripting

**URL:** <https://forum.inductiveautomation.com/t/get-current-scope-in-scripting/55686>\
**Category:** General Discussion\
**Created:** [February 2, 2022, 9:35pm UTC](https://forum.inductiveautomation.com/t/get-current-scope-in-scripting/55686 "2022-02-02T21:35:03Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [February 2, 2022, 11:50pm UTC](https://forum.inductiveautomation.com/t/get-current-scope-in-scripting/55686/6 "2022-02-02T23:50:38Z")

</div>

We’ve got this in a script called env

```auto
from com.inductiveautomation.ignition.common.model import ApplicationScope

scope = ApplicationScope.getGlobalScope()

def isDesigner():
	return ApplicationScope.isDesigner(scope)

def isGateway():
	return ApplicationScope.isGateway(scope)
	
def isPerspective():
	return ApplicationScope.isGateway(scope) and hasattr(system,'perspective')

def isVision():
	return ApplicationScope.isClient(scope)

```

Then call it with env.isGateway() etc…

---

_[View the full topic](https://forum.inductiveautomation.com/t/get-current-scope-in-scripting/55686)._
