[1.1.2] Mac: Cannot capture top menu bar and dock items

Asked by mark Yang on 2018-06-21

Just downloaded 1.1.2 and following' hello world' tutorial.
'Take Screenshot' only allows me to capture the screen excluding those top bar bottom app short cut bar.

Thanks,
Mark

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
2018-06-22
Last query:
2018-06-22
Last reply:
2018-06-22
Best RaiMan (raimund-hocke) said : #1

This is a restriction on Mac, that cannot be solved in the current version.

To capture something in these areas, you have to start the SikuliX IDE capture outside and then move in (only parts of the section rectangle are visible then).

Another option is, to capture using the Mac feature and then insert the image into the SikuliX IDE.

Be aware: Mac capture on retina displays creates images that are double-sized in pixels in width and height.
Before such an image can be used in SikuliX it must be scaled down with the factor 0.5 for both width and height.
This can be done with Mac Preview app before inserting the image into the IDE.

With the next nightly build of 1.1.3 (later today) there will be a "scale-before-search" option available, which could be used in Retina situation like so:
img = Pattern("some-inserted-mac-retina-capture.png").resize(0.5)
hover(img)

which would reduce the capture effort on Retina to these steps:
- capture with Mac tool
- insert image in IDE as Pattern(img).resize(0.5)

mark Yang (myang999) said : #2

Thanks RaiMan, that solved my question.