I am using VS CODE to develope a Robot with Robot Framework and Sikuli. When I run my script I get an error
"could not find P(sage.png)"
This happen because the current screen is the VS CODE's screen and not the desktop where the "sage.png" is.
What I can use in my script in order to focus on desktop screen first of all?
I just looked at the documentation of sikuli. You can make use of the below method, where they have specifically talked about your issue.
classmethod focusedWindow()
On Windows, this method always returns a region. When there is no window opened on the desktop, the region may refer to a special window such as the task bar or an icon in the system tray.
# highlight the currently fontmost window for 2 seconds
App.focusedWindow().highlight(2)
# save the windows region before
firstWindow = App.focusedWindow()
firstWindow.highlight(2)