# cursor location

**URL:** <https://forum.inductiveautomation.com/t/cursor-location/43234>\
**Category:** Ignition\
**Created:** [February 10, 2021, 1:55pm UTC](https://forum.inductiveautomation.com/t/cursor-location/43234 "2021-02-10T13:55:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dominique.louis1](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@Dominique.louis1](https://forum.inductiveautomation.com/u/Dominique.louis1)\
**Post date:** [February 10, 2021, 1:55pm UTC](https://forum.inductiveautomation.com/t/cursor-location/43234/1 "2021-02-10T13:55:53Z")

</div>

Hello,  
I would like to select the position of the cursor when opening my page, to facilitate entering information in cells.  
thank you in advance for your help.  
Dominique

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [February 10, 2021, 2:42pm UTC](https://forum.inductiveautomation.com/t/cursor-location/43234/2 "2021-02-10T14:42:09Z")

</div>

On your window, right-click and choose scripting. Place a script in the `visionWindowOpened` event handler.

```auto
def focus():
    system.gui.getParentWindow(event).getComponentForPath('Root Container.Text Field').requestFocusInWindow()
system.util.invokeLater(focus)

```

---

<div class="post-metadata">

**Author:** ![Dominique.louis1](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@Dominique.louis1](https://forum.inductiveautomation.com/u/Dominique.louis1)\
**Post date:** [March 9, 2021, 11:53am UTC](https://forum.inductiveautomation.com/t/cursor-location/43234/3 "2021-03-09T11:53:46Z")

</div>

i try but there is a problem  
Error running function from `fpmi.system.invokeLater`  
Traceback (most recent call last):  
File “event:visionWindowOpened”, line 2, in focus  
AttributeError: ‘NoneType’ object has no attribute ‘requestFocusInWindow’

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 9, 2021, 2:10pm UTC](https://forum.inductiveautomation.com/t/cursor-location/43234/4 "2021-03-09T14:10:20Z")

</div>

> [@dkhayes117](#):
>
> getComponentForPath('Root Container.Text Field')

Make sure your path to the component is correct. If your component is not named 'Text Field' or if it is in a group, the path will be different and need to be modified. Next thing to check is whether your component you want to be in focus is in the main, or parent window, or if it is in a popup window. If the latter, the script will need to be altered.

---

<div class="post-metadata">

**Author:** ![Dominique.louis1](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@Dominique.louis1](https://forum.inductiveautomation.com/u/Dominique.louis1)\
**Post date:** [March 9, 2021, 2:25pm UTC](https://forum.inductiveautomation.com/t/cursor-location/43234/5 "2021-03-09T14:25:39Z")

</div>

the path seems correct to me.  
what I don’t understand is  
“AttributeError: ‘NoneType’ object has no attribute ‘requestFocusInWindow’”

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 9, 2021, 2:27pm UTC](https://forum.inductiveautomation.com/t/cursor-location/43234/6 "2021-03-09T14:27:16Z")

</div>

It seems that is not finding the component, which is why it is of type `None`

---

<div class="post-metadata">

**Author:** ![Dominique.louis1](https://avatars.discourse-cdn.com/v4/letter/d/ce7236/32.png) [@Dominique.louis1](https://forum.inductiveautomation.com/u/Dominique.louis1)\
**Post date:** [March 9, 2021, 2:31pm UTC](https://forum.inductiveautomation.com/t/cursor-location/43234/7 "2021-03-09T14:31:43Z")

</div>

THANK YOU  
you were right it was a problem of the way.  
cordially
