Sikuli doesn't see opened applications on mac os

Asked by Jerome

Hi,

My environment:
- Mac OS Catalina 15.2
- SikuliX 2.0.1, fresh install

When invoking screen.capture(), Sikuli always save an "empty" desktop, with no apps running. You know, the desktop with only the default wallpaper you have when you're creating a new desktop, or if you close all your apps !

It's the same when I'm using IDE and capture, all my running apps I want to use with SikuliX are not there, and sikulix asks me to pick a region on a "blank" desktop.

I tried to do showScreens() :

*** monitor configuration [ 1 Screen(s)] ***
*** Primary is Screen 0
Screen 0: R[0,0 1680x1050]@S(0)
*** end monitor configuration ***

I have no other monitor connected (checked in mac settings / monitors), and it does as if there was one. Strange.

Thanks !

Question information

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

check, that you have allowed all otherwise blocked actions in SystemPreferences -> Privacy (especially ScreenRecording)

Revision history for this message
Jerome (jdumont2) said :
#2

just checked. We are talking about java, right ? It is not present in the list of applications in Screen Recording tab, in Security preferences. As it didn't request access. It is allowed though to get documents, and control all computer in "Accessibility" tab. Do you have java in this list in your environment ?

I just git cloned code and am running mvn install, to get faster, can you tell me which package / class do I have to check if I want to make some debug about it ?

Thanks for your help !

Revision history for this message
Jerome (jdumont2) said :
#3

here's sikuli script I use

import org.sikuli.script.ImagePath;
ImagePath.setBundlePath('/Users/jman/Documents/sikuli/images');

screen = Screen()
screen.showScreens()

file = screen.capture(screen.getBounds())
print("Saved screen as "+file.getFilename())

wait('button');
print('ok');

Revision history for this message
Jerome (jdumont2) said :
#4

OK I finally got it !

I think I messed up when initially the macos popup asked me to authorize java to register screen. Once you deny, it never comes back :( And it's not in this f** list.

I had to install Sikuli 1.1, which provokes macos to ask me if java could register screen, and this time I opened system preferences and java showed up ! once checked, I could reopen sikuli 2 and it worked

Security is good but I think it lacks ergonomy in last MacOS Catalina !!! Hope it will be better in the future with a better UX.

Thanks