# Can I tell what scope a script is running from?

**URL:** <https://forum.inductiveautomation.com/t/can-i-tell-what-scope-a-script-is-running-from/70880>\
**Category:** Ignition\
**Tags:** perspective, scripting, vision\
**Created:** [March 10, 2023, 4:54am UTC](https://forum.inductiveautomation.com/t/can-i-tell-what-scope-a-script-is-running-from/70880 "2023-03-10T04:54:46Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [March 13, 2023, 6:35pm UTC](https://forum.inductiveautomation.com/t/can-i-tell-what-scope-a-script-is-running-from/70880/8 "2023-03-13T18:35:34Z")

</div>

This is what we do to determine scope in a script

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

def getScope():
	scope = ApplicationScope.getGlobalScope()
	if ApplicationScope.isClient(scope):
		return "c"

	if ApplicationScope.isDesigner(scope):
		return "d"

	if ApplicationScope.isGateway(scope):
		if "perspective" in dir(system):
			return "p"
		return "g"
	return "u"

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/can-i-tell-what-scope-a-script-is-running-from/70880)._
