setApp (java)

Asked by carl

I'd like to move from 1 Region to 1 Appor Screen to 1 app.
I need something similar to Screen.currentWindow() with static App return.

in my case, I can not use:
App someapp = new App();
someapp=App.open("...");

I wish Sikuli be able to automatically determine the position(+ size) of the window in the screen (this solves any transfer of window)

I try:
 App someapp = new App("..");
someapp= App.open("......\\iexplore.exe");
someapp.window().highlight(5);
It opens the exe but I don't have highlight!!

Question information

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

you have to wait for the IE to startup and establish the window (might take a second+).
In your case the someapp.window() comes too fast.

--- with version 1.1.0:
scr = new Screen();
ie = new App("......\\iexplore.exe")
ie.open()
while (! ie.isRunning()) {
    scr.wait(0.5);
}
ie.window().highlight(2)

Revision history for this message
carl (maibannato) said :
#2

Thanks , But, How Can I use App class without know the file path, or (Directly) Once the program Window is open???

Revision history for this message
RaiMan (raimund-hocke) said :
#3

did you try the above (comment #1)?

All this is now handled inside the App class:
http://sikulix-2014.readthedocs.org/en/latest/appclass.html#the-application-class-app

Revision history for this message
carl (maibannato) said :
#4

yes, I do not have the chance to start with App.open

( not because Sikuli can not , just because in my program this is not the way I want to do )
I need
someapp=Screen.correntWindow();

if there isn't something like this I working on region, but don't use App it's a shame.

Revision history for this message
RaiMan (raimund-hocke) said :
#5

--- I do not have the chance to start with App.open
what is you problem with that?

--- someapp=Screen.correntWindow();
the docs:
http://sikulix-2014.readthedocs.org/en/latest/appclass.html#the-application-class-app

as mentioned in comment #3 has all that is available.
seems you need:
App.focusedWindow()

Revision history for this message
carl (maibannato) said :
#6

----- I do not have the chance to start with App.open
--what is you problem with that?
The main of the program generates several windows and these windows I would use the App class

App.focusedWindow() return region, I need the opposite From one Region to arrive at App..

App app;
app=function_I_Need();
.....
.....
app.close();

#3
I think that there is not what I look for. (no big deal, I wander the obstacle) I hope that: if this is interesting request can be developed.