App.close fails to close

Asked by Jeff_Vallis

1.1.0(2015-07-21_01:00nightly)/Mac10.10.4/Java8(64)1.8.0_25-b17

def Gen_Close_App():
    global Which_App
    App.close(Which_App)
    #closeApp(Which_App)
    print "Gen_Close_App() ",Which_App

Which_App = "Tuck"
Gen_Close_App()

Result :-
Gen_Close_App() Tuck

but app still running

Opening the App works fine :-
def Gen_Open_App():
    global Which_App
    App.open(Which_App);
    wait(1)
    App.focus(Which_App)
    App.open(Which_App);
    wait(1)
    App.focus(Which_App)
    print "Gen_Open_App() ",Which_App

Which_App = "Tuck"
Gen_Open_App()
result :-
[log] App.open [-1:Tuck]

[log] App.focus: [-1:Tuck]
[log] App.open [-1:Tuck]

[log] App.focus: [-1:Tuck]
Gen_Open_App() Tuck

I saw from reading instructions that the name needs to be the name in the Tool Bar - I presume that this means the name in the Dock
Tuck is the name in the Dock and also the name in Activity Monitor
I also tried the above with
          Which_App = "Google Chrome"
          Which_App = "Safari"

and failed to get it to close

is this a bug or am I doing something wrong

what is Tuck - Tuck is a Fluid Application - http://fluidapp.com/
Fluid allows you to load a specific web site

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

tested with latest build (your config).

this works:

saf = App("Safari") # create App instance

saf.open() # open it
wait(3)

saf.close() # close it

conclusion: use the instance methods instead of the class methods

(nevertheless: App.close("Safari") should work also, but does not do yet ;-)

Revision history for this message
Jeff_Vallis (vallis-pj) said :
#2

Thanks RaiMan, that solved my question.

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

I just fixed the problems with the class methods.
With tomorrow's build your usage should work also.
Would be nice if you test it.

Revision history for this message
Jeff_Vallis (vallis-pj) said :
#4

Tested
1.1.0(2015-08-20_01:00nightly)/Mac10.10.4/Java8(64)1.8.0_25-b17

App.close("TheApp") now works fine

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

@Jeff: thanks