Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Sikuli 我有一个图像,我需要检查下半部分的 1/4 是否存在,如果存在,请使用特定功能。现在我有:
if(image.exists()) click()
不过,这个问题是 .exists 会挂起脚本或功能不正确。我正在寻找一种更好的方法来做到这一点或解决这个问题。任何帮助,将不胜感激
示例是有一个附加段,因此您在一个版本中选择全部(它结束的地方),然后在较新版本中选择时间/日期。希望能够通过图像选择时间/日期的附加选项。
这应该是您正在寻找的:
noteApp = App("notepad.exe") click("editbutton-1.png") region = Region(noteApp.focusedWindow()) print(region.text())
您可以将 region.text() 设置为等于您要查找的字符串,例如日期/时间,并创建一个语句来运行您的函数