Similar Function App.waitVanish('someapp')

Asked by yop

Hello,

I am looking for a function like :
waitVanish("image.png", FOREVER)
but for a process or an application .....so llike this :-) :
App.waitVanish('someapp', FOREVER)

have you any idea for that function ?
Thanks for your feedback
Regards

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
RaiMan (raimund-hocke) said :
#1

already checked the observe feature?

Revision history for this message
yop (fraise) said :
#3

Error is :
"AttributeError: type object 'App' has no attribute 'waitVanish'

Regards

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

Already looked into the docs?

what about comment #1?

Revision history for this message
yop (fraise) said :
#5

yes ...but i am not an expert :-)
I looked again the last docs "Sikulix 2014 - 01 2018" (very nice)
i wanted to try the function " "myApp.windows"

for exemple -1- with Firefox NOT starting and command "if not"
myApp = App('Firefox')
if not myApp.window():
      App.open ('gnome-terminal')
wait(1)
--> OK its Working a gnome-terminal Start

for exemple -2- whith Firefox STARTING and command "if"
myApp = App('Firefox')
for step in range (60):
if myApp.window():
      wait(1)
App.open ('gnome-terminal')
Not OK --> a gnome-terminal starting immediatly.

Regards

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

myApp = App('Firefox')
for step in range (60):
    if not myApp.window():
        wait(1)
App.open ('gnome-terminal')

Revision history for this message
RaiMan (raimund-hocke) said :
#7
Revision history for this message
yop (fraise) said :
#8

thanks for your reply.
It's looks exaclty i need !

It's looks Working whit FireFox.
My problem comme from whit an another app i lauch it by start a Gnome-Terminal and paste "LD LIBRARY PATH ....... ./myApp "
i think sikuli don't know "myApp" is lauched or not whit this method.

I need to try another method to lauch myApp.

Thanks RaiMan for the help you gave me!

Revision history for this message
yop (fraise) said :
#9

Hello,

After some Holidays and few tests. For information the solution for me is the following script :
myApp=App('PathtoMyApp')
myApp.open()
wait(1)
for n in range (30): #time out at 30s
       if myApp.window() :
             wait(1)
       else : break
....
....

Whit this script during the loop of 30s, if i kill by myself the application " myApp", immediatly the loop stops to keep the script.

If i change "myApp.window()" by "myApp.isRunning()"
--> Its works if the application is stoped by Sikuli Script like "myApp.close()"
--> It doesnt work if i kill the application by myself
...i don't know if my explainations are so clear :-)

Thanks
Yopcitron

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

Thanks for the information - very clear ;-)

I guess the problem is, that for Linux the App features are not all completely implemented - sorry for the inconvenience.

Revision history for this message
yop (fraise) said :
#11

Thanks for your reply, your support and Sikulix !!!

Revision history for this message
yop (fraise) said :
#12

Thanks RaiMan, that solved my question.