How to click on current date using sikuli?

Asked by Kirankumar deshpande

I have to install daily build and would like to click on current date using Sikuli?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Best Manfred Hampl (m-hampl) said :
#1

I see two possibilities:

1. If the position of the current date is always the same on the screen (e.g. 150 pixels from the top, 30 pixels from the left), then you use that position as your click target.
https://sikulix-2014.readthedocs.io/en/latest/region.html#Region.click
click(Location(x,y))
(replace x and y by the desired coordinates)

2. If you know the date format that is used to indicate the current date on the screen, then you can construct a string of today's date in this format and try to find it on the screen.
https://sikulix-2014.readthedocs.io/en/latest/region.html#Region.find
find(time.strftime(%m/%d/%Y))
(adapt the format string as applicable; "import time" probably required at the beginning of the script)

Revision history for this message
Kirankumar deshpande (kirand081) said :
#2

Thanks Manfred Hampl, that solved my question.