Unable to close the Application/opened window on Mac using Java Sikuli script

Asked by Madhusudhan

Hi All.. I started using Sikuli very recently..
am trying to run a Java Sikuli script on Eclipse to install the application, its running fine no issues with that.

But When I try to close the Application which is opened thru App.close("Finder"), since am working on Mac, the app is not closing.
Also i tried to get the focused window and close but did not work.
Pls suggest some ways to close the opened windows.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Bekir Dogru (bekirdogru) said :
#1

If you can focus with App.focus then App.close should be working...

If your jre isn't jre then sikuli sometimes gives some little errors that is impossible to understand why? (At least for me) check your jre...

other recommended solutions:

- (Not very likely) use closeApp(....)

- (Bad method) first focus on that app, then find your traffic lights :) on top left of the window then click close button...

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

@ Bekir:
since we are on a Mac, the App class works totally different than on Windows. On Mac you cannot access different windows using part of the window title as you can do on Windows.

-- The JRE is definitely not the problem here.
-- closeApp() is the same as App.close() internally

@ Mahusudhan
In the standard (I guess you have it) the app Finder cannot be closed.
So I guess you meant closing an open Finder window.

Using
App.focus("Finder")
should bring the frontmost Finder window to front.

To close this window use the shortcut:
type("w", KeyModifier.CMD)

Revision history for this message
Madhusudhan (madhusudhan-jr) said :
#3

Hi RaiMAn, thanks for the reply..

But even though I do App.focus("Finder") and then type shortcut key, my Finder window is not getting closed.
with the Finder wimdow am having my installer window, so installer window is getting closed.
Is their any chance to close all the open windows in a single shot??

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

No, you have to repeat the above step ( check App.window() ) until no more windows are open.

Can you help with this problem?

Provide an answer of your own, or ask Madhusudhan for more information if necessary.

To post a message you must log in.