# system.nav.getCurrentWindow() does not work in designer mode

**URL:** <https://forum.inductiveautomation.com/t/system-nav-getcurrentwindow-does-not-work-in-designer-mode/12683>\
**Category:** Ignition\
**Created:** [February 15, 2017, 9:55pm UTC](https://forum.inductiveautomation.com/t/system-nav-getcurrentwindow-does-not-work-in-designer-mode/12683 "2017-02-15T21:55:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gekkoman](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gekkoman](https://forum.inductiveautomation.com/u/gekkoman)\
**Post date:** [February 15, 2017, 9:55pm UTC](https://forum.inductiveautomation.com/t/system-nav-getcurrentwindow-does-not-work-in-designer-mode/12683/1 "2017-02-15T21:55:05Z")

</div>

system.util.getProjectName() works fine in designer but system.nav.getCurrentWindow() does not

Using 7.9

My work around:

With component “comp” from target window

```auto
from com.inductiveautomation.factorypmi.application import FPMIWindow
if system.util.getSystemFlags() & system.util.DESIGNER_FLAG:
	while not isinstance(comp.parent,FPMIWindow):
		comp=comp.parent
	curWindow=comp.parent.getPath()
else:
	curWindow=system.nav.getCurrentWindow()
```

---

<div class="post-metadata">

**Author:** ![adam.morales](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/adam.morales/32/3405_2.png) [@adam.morales](https://forum.inductiveautomation.com/u/adam.morales)\
**Post date:** [February 16, 2017, 11:36pm UTC](https://forum.inductiveautomation.com/t/system-nav-getcurrentwindow-does-not-work-in-designer-mode/12683/2 "2017-02-16T23:36:19Z")

</div>

That is a nice workaround for testing functions using this method in the designer.

Just to be clear, this is the expected behavior since getCurrentWindow() returns the path to the currently maximized window, and the designer does not display maximized windows.

For completeness, I would also like to mention that, in cases where the script is called from a component event, system.gui.getParentWindow(event).getPath() can also be used.
