Help needed is usage of SwitchApp

Asked by Venkata Sandeepu Lade

Hi ,
I am trying to use SwitchApp function to switch from one application to another . But switchApp is opening duplicate window of the required application. Please help

openApp("D://Putty.exe")
openApp("cmd.exe")
type("ipconfig")
type(key.ENTER)
switchApp("D://Putty.exe")

the above is opening one more putty window

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

On Windows, if you want to switch to an already opened app, you have to use a unique part of the windows title text, you want to switch too.

in your case "D://Putty.exe" is not part of any open window's title text, so Putty is opened again.

If e.g. "Putty" is in the window title:
switchApp("Putty")

might do it, if only one Putty window is open at that time. Otherwise you have to take more text from the window title, to make it more distinguishable.

Revision history for this message
Venkata Sandeepu Lade (venkatasandeep-lade) said :
#2

Thanks RaiMan.. I am able to swith applictaions now

Revision history for this message
Venkata Sandeepu Lade (venkatasandeep-lade) said :
#3

Thanks RaiMan, that solved my question.