Auto Cursor for Vision (windows to template)

forum
forum1
Script--
window = system.gui.getWindow("Main_View_Trace")
component = window.getComponent("Root Container.tpMainView.Text Field 3").requestFocus()
#component.requestFocus()
system.gui.getParentWindow(event).getComponentForPath('Root Container.testttt').requestFocusInWindow()

This is my Auto Cursor script for Template from windows. But I like this kind of error. How to fix this error

If you like the error, why would you get rid of it? :slight_smile:
I'm pretty sure theres a function getComponentFromPath or something. It's been a while since I used vision, but fairly confident that getComponent can only be supplied with a single component and you have to stack them, although that error suggests it should be an integer...

Containers (like a root container) have a .getComponent() method that takes the string name of a single component. Window objects do not have this method, just the native Swing method that takes an integer.

But, window objects do have the .getComponentForPath() method that takes a complete path string. You are mixing the two.

1 Like

I was so close!
But wait, the OP is already using this function :sweat_smile: I didn't see it as it's difficult to read code not in a code block