# Detect that we are in Designer for Script

**URL:** <https://forum.inductiveautomation.com/t/detect-that-we-are-in-designer-for-script/23067>\
**Category:** General Discussion\
**Created:** [March 5, 2019, 2:29pm UTC](https://forum.inductiveautomation.com/t/detect-that-we-are-in-designer-for-script/23067 "2019-03-05T14:29:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dannymichaud](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@Dannymichaud](https://forum.inductiveautomation.com/u/Dannymichaud)\
**Post date:** [March 5, 2019, 2:29pm UTC](https://forum.inductiveautomation.com/t/detect-that-we-are-in-designer-for-script/23067/1 "2019-03-05T14:29:08Z")

</div>

I got a client that execute a switchuser command in a client tag. I wonder if it’s possible to detect that we are in designer because the switchuser command is not allowed in the designer and popping up a warning

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [March 5, 2019, 3:21pm UTC](https://forum.inductiveautomation.com/t/detect-that-we-are-in-designer-for-script/23067/2 "2019-03-05T15:21:10Z")

</div>

You would want to use [system.util.getSystemFlags](https://docs.inductiveautomation.com/display/DOC79/system.util.getSystemFlags), or check the `[System]Client/System/SystemFlags` tag (the values on the tag should match with the table on the function page in the user manual).

```auto
if system.util.getSystemFlags() > 2:
    #switchUserStuffHere

```

---

<div class="post-metadata">

**Author:** ![Dannymichaud](https://avatars.discourse-cdn.com/v4/letter/d/48db29/32.png) [@Dannymichaud](https://forum.inductiveautomation.com/u/Dannymichaud)\
**Post date:** [March 6, 2019, 4:25pm UTC](https://forum.inductiveautomation.com/t/detect-that-we-are-in-designer-for-script/23067/3 "2019-03-06T16:25:28Z")

</div>

Thank you! perfect for my case
