Re: [Sikuli-driver] [Question #698490]: Using custom c++ dll in Sikulix
Question #698490 on SikuliX changed: https://answers.launchpad.net/sikuli/+question/698490 matteoa posted a new comment: Hello RaiMan, thanks for you response I've found this extension: www.jyni.org Whose creator claim that is able to use the standard Ctype from "standard" Python that could solve my problem. Any experience with that? I'll give it a try, and report here as soon as I understand how to install and make it work not being an expert in Java, nor Python...;-) Thanks a lot! -- You received this question notification because your team Sikuli Drivers is an answer contact for SikuliX. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #698490]: Using custom c++ dll in Sikulix
New question #698490 on SikuliX: https://answers.launchpad.net/sikuli/+question/698490 Hello, I've written a small c++ dll to crypt and decrypt strings, I have to use it from .net and from Sikulix; it works if called from .net code. The two functions have these prototypes: int encrypt( char str2Encrypt[]); void decript(unsigned char strDecrypt[]); Checking in the Jython source I've found c:\jython2.7.2\Lib\ctypes\__init__.py that gave me some hints about how to load it: import ctypes from ctypes import * libc = ctypes.LibraryLoader (".\\DllPAss.dll") And this works (at least no runtime error), the output of the print libc line is: . My problem is that then I'm stuck since the line: libc.LoadLibrary("encrypt") and others attempt I've done outputs these errors: [error] script [ testScript ] stopped with error in line 17 [error] TypeError ( 'str' object is not callable ) [error] --- Traceback --- error source first line: module ( function ) statement 289: __init__ ( LoadLibrary ) return self._dlltype(name) 17: main ( ) libc.LoadLibrary("encrypt") [error] --- Traceback --- end -- I'm not an expert of python, so the problem could be that I'm simply ignoring the way it should be, does anyone has an example to follow? Thanks in advance My config is as follows: sikulix 2.0.5, java version "1.8.0_291" Java(TM) SE Runtime Environment (build 1.8.0_291-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode) -- You received this question notification because your team Sikuli Drivers is an answer contact for SikuliX. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #694279]: Region.text() - number Recognition
Question #694279 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/694279 matteoa posted a new comment: Hello Javier, I've had the same problem and I managed to mitigate it with these functions: OCR.globalOptions().variable("tessedit_char_whitelist", "PCBU0123456789ABCDEF") OCR.globalOptions().variable("tessedit_char_blacklist", "abcdefGgHhIiLlMmNnOopQqRrSsTtuVvZzJjYyKkWw-!|") OCR.globalOptions().configs("bazaar") OCR.globalOptions().variable("load_system_dawg", "F") OCR.globalOptions().variable("load_freq_dawg", "F") OCR.globalOptions().psm(6) OCR.globalOptions().variable("user_patterns_file", "C:\\Sikulix\\Util\\OCR.Pattern") and the content of the file (strictly tailored for my need) is: P\n\n\n\n C\n\n\n\n B\n\n\n\n U\n\n\n\n Here some info I used to get a better OCR: https://stackoverflow.com/questions/17209919/tesseract-user-patterns https://github.com/tesseract-ocr/tesseract/blob/master/doc/tesseract.1.asc#config-files-and-augmenting-with-user-data I said "mitigate" since the problem got better but was not completely solved. Hope this helps -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #692958]: tesseract pattern not enforced?
Question #692958 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/692958 matteoa posted a new comment: HI, I received the email with responses from the Great RaiMan but I'm unable to see them here. I routed the question to the TEsseract user group, will report if I'll got responses: https://groups.google.com/g/tesseract-ocr/c/Hmv6YlWYXB8 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #692958]: tesseract pattern not enforced?
New question #692958 on Sikuli: https://answers.launchpad.net/sikuli/+question/692958 Hello, I'm trying to OCR a text field on the target that contains codes that have a pattern ( implemented as pattern file in tesseract terms): P\n\n\n\n C\n\n\n\n B\n\n\n\n U\n\n\n\n In practice there is a letter that can be P or C, or B or U and then 4 more hex digits. The length is always exactly 5 char in total. So, at least in my intention with this pattern file, correct output would be, as examples: P0123, P2EFD, C12EF, B2BCD and so on. Running the script I see that the vast majority of the output is as expected but I have also some results like PPB, PFF3,CC3 and so on. Is there a way I can enforce more the adherence to the pattern I setup in Sikulix (Jython) like this: OCR.globalOptions().variable("user_patterns_file", "C:\\Sikulix\\Util\\Code_OCR.Pattern") OCR.globalOptions().variable("tessedit_char_whitelist", "PCBU0123456789ABCDEF") OCR.globalOptions().variable("tessedit_char_blacklist", "abcdefGgHhIiLlMmNnOopQqRrSsTtuVvZzJjYyKkWw-!|") OCR.globalOptions().variable("load_system_dawg", "F") OCR.globalOptions().variable("load_freq_dawg", "F") Thanks in advance. My configuration is: 2.0.4-2020-03-14_08:01/Windows10.0/Java8(64)1.8.0_251-b08 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #692727]: OCR.oem(0) crash when variables set
Question #692727 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/692727 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #692723]: OCR.readLines how to intepret results?
Question #692723 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/692723 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #692723]: OCR.readLines how to intepret results?
Question #692723 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/692723 matteoa posted a new comment: hello, even a simple example would be appreciated... Thanks -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #692727]: OCR.oem(0) crash when variables set
New question #692727 on Sikuli: https://answers.launchpad.net/sikuli/+question/692727 hello, I'm setting up some OCR variables to have better results in OCRing some text that is a kind of code (so no dictionaries): #OCR.globalOptions().oem(0) OCR.globalOptions().variable("tessedit_char_whitelist", "0123456789ABCDEF") OCR.globalOptions().variable("tessedit_char_blacklist", "SsOo") OCR.globalOptions().variable("load_system_dawg", "F") OCR.globalOptions().variable("load_freq_dawg", "F") Since I've read on the web that LTSM for tesseract 4 seems not to take into account the black and white lists (I verified that there are results that doesn't match with these) I tried with the old behavior oem(0) by uncomment the first line above. When I try to do OCR with this OEM I have a crash with this message: [error] script [ myscript ] stopped with error in line 571 [error] java.lang.Error ( java.lang.Error: Invalid memory access ) [error] --- Traceback --- error source first line: module ( function ) statement 571: main ( ) linescode=rAppo.textLines() [error] --- Traceback --- end -- While with the commented line above it works but with the OCR problems I wrote above the question is: what I'm missing/doing wrongly? Thanks a lot for support this is my configuration: 2.0.4-2020-03-14_08:01/Windows10.0/Java8(64)1.8.0_251-b08 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #692723]: OCR.readLines how to intepret results?
New question #692723 on Sikuli: https://answers.launchpad.net/sikuli/+question/692723 hello, I'm trying to parse an image similar to an excel spreadsheet that contains lines of text that I have to OCR and have divided one per row. I was using something like: ListStr=rAppoDTC.textLines() obtaining a list of the text present one by one on the lines. Now I'd like to use OCR.readLines But this API returns a list of matches instead of a list of strings. I suppose there is a way to extract also the text. I've tried this: linescode=rAppoDTC.textLines() log.writeLogAll ("Lines="+str(linesPcode)) it works linescode2=OCR.readLines(rAppoDTC) for m in linescode2: apporeg=Region(m) log.writeLogAll ("LinesText=" + OCR.readText(apporeg)) and this gives me this error: [error] java.lang.NullPointerException ( java.lang.NullPointerException ) [error] --- Traceback --- error source first line: module ( function ) statement 576: main ( ) log.writeLogAll ("LinesText=" + OCR.readText(apporeg)) [error] --- Traceback --- end -- The main question is: how do I extract text from the matches that are returned by OCR.readLines? this is my configuration: 2.0.4-2020-03-14_08:01/Windows10.0/Java8(64)1.8.0_251-b08 Thanks in advance -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #692711]: textLines method for region options only global?
Question #692711 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/692711 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #692711]: textLines method for region options only global?
New question #692711 on Sikuli: https://answers.launchpad.net/sikuli/+question/692711 hello, I'm using this method: region..textLines() to get all the lines in a region of the screen, the PSM is set to 6. Trying to get better the OCR reconnaissance for one of the fields that contains acronyms I found some variables that make the OCR far better: tessedit_char_whitelist:PCBU0123456789ABCDEF load_system_dawg:F, load_freq_dawg:F Everything is ok, I have here a couple of doubts: I have to change frequently this setting, since this setting is ok only for one of the fields I have to "read" while others have to be read with the standard behavior; I read all the page, then refresh and read again and so on. Is there a way to reset only these variables without calling OCR.globalOptions().reset()? The method like OCR.readLine can be used with a custom set of options, but the method I'm using seems to be a method of the region class, is this correct? If so, how can I build a custom set of ocr options to be applied only when needed without the need to setup the globaloptions for a filed and then reset them for the other fields? Another possibly silly question: the setting of the latter two variables is correct to disable the use of the standard dictionaries or is needed a "0" instead of the "N"? Thanks for support and excuse me if this is a silly question... This is my configuration: 2.0.4-2020-03-14_08:01/Windows10.0/Java8(64)1.8.0_251-b08 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #691769]: Tesseract variable user_defined_dpi Sikulix Default value=300 --- should be ignored/not used
Question #691769 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/691769 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #691769]: Tesseract variable user_defined_dpi Sikulix Default value=300?
New question #691769 on Sikuli: https://answers.launchpad.net/sikuli/+question/691769 hello, this is my configuration: 2.0.4-2020-03-14_08:01/Windows10.0/Java8(64)1.8.0_251-b08 I'm working on an OCr application so I'm exploring the various OCr optimizations. The output of this line: print str(OCR.globalOptions()) Is this one: OCR.Options: data = C:\Users\Myself\AppData\Roaming\Sikulix\SikulixTesseract\tessdata language(eng) oem(3) psm(3) height(15,1) factor(1,99) dpi(96) variables: user_defined_dpi:300 I did not set intentionally the user_defined_dpi so I thought it was one of experimental stuff I did to set it as default, so I did this:OCR.globalOptions().variable("user_defined_dpi", "0") to reverse the change to the "natural" default, and the output was accordingly "variables: user_defined_dpi:0". Then I commented out the setting of 0 for user_defined_dpi and the initial value of 300 was back! So my question is: the default value for user_defined_dpi in sikulix is 300? if not, why, if I'm not setting it intentionally, the value it is set this way? Maybe is there some config file I should edit/remove to bring tesseract stuff back to the default? Which is the default value in Sikulix for user_defined_dpi? Thanks for support Last thing: sometimes in the printout of OCR.globalOptions() i see that the data parameter is set to "none", this seems not to have effects on the Ocr operation, so is possibly only a printout problem, or may it be something I should take care of? -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #691484]: Ocr in Match doesn't match with Match position after position editing
Question #691484 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/691484 matteoa posted a new comment: thanks a lot!! do you have idea about when the 2.0.5 will be published? -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #691484]: Ocr in Match doesn't match with Match position after position editing
Question #691484 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/691484 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #691484]: Ocr in Match doesn't match with Match position after position editing
New question #691484 on Sikuli: https://answers.launchpad.net/sikuli/+question/691484 Hello, below there is my snippet extracted from a bigger script: I look for an image that is the heading of a column in a table. Then I modify the match coordinates to look for the first row of the table (rDesc.getY()+24), the highlighting of the match confirm me that the position is correct. But then when I do the OCR the returned string is the OCR of the heading, not the content of the cell. To get the content of the cell I have to use the 2 commented lines below that builds a region with the same coordinates of the Match. >From my understanding it should work also without using the Region explicit >assignment. The question is: what do I missed? rDesc=find("Heading.png") rDesc.setY(rDesc.getY()+24) rDesc.highlight(1) str1Desc=ocr.getLineText(rDesc) #rAppoDesc=Region(rDesc.getX(),rDesc.getY(),rDesc.getW(),rDesc.getH()) #str1Desc=ocr.getLineText(rAppoDesc) My config is: 2.0.4-2020-03-14_08:01/Windows10.0/Java8(64)1.8.0_251-b08 I found a workaround so this is not a "bloking" issue, but I'd like to know what's wrong... Thanks for support -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #691383]: how to use OCR.readLines?
Question #691383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/691383 matteoa posted a new comment: Hi RaiMan, thanks for prompt response!! I've tried your snippet, slightly modified (the list does not exists and PSM 6 is absolutely needed): textOCR.setPSM(6) reg = selectRegion() lines = reg.textLines() for line in lines: uprint(line) Works perfectly!! Thanks!!! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #691383]: how to use OCR.readLines?
Question #691383 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/691383 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, this solved my problem! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #691383]: how to use OCR.readLines?
New question #691383 on Sikuli: https://answers.launchpad.net/sikuli/+question/691383 hello, first of all, my config is: 2.0.4-2020-03-14_08:01/Windows10.0/Java8(64)1.8.0_251-b08 I have to do OCR on a table, it work rather well if I do it line by line. I thought it could be faster to do it at once with OCR.readLines and psm = 6 so I tried to read the entire table in an image and then pass it to OCR.readLines. This is my test code that uses manual screen region selection: img=selectRegion() imgFile=capture (img) OCR.options.psm(6) lstText=OCR.readLines(img) print "lstLEN=" + str(len(lstText)) print "lst=" + str(lstText) for i in range(len(lstText)): print "mat="+str( lstText[i]) print "Txt="+OCR.readLine(lstText[i]) exit(0) >From the output I see that there are 16 matches, that is correct, but then the print "Txt="+OCR.readLine(lstText[i]) line gives an error: error] script [ GM_DTC ] stopped with error in line 127 [error] java.lang.NullPointerException ( java.lang.NullPointerException ) [error] --- Traceback --- error source first line: module ( function ) statement 344: Utility ( getLineText ) strOcr = OCR.readLine(rReg, self.options) 127: main ( ) print "Txt="+OCR.readLine(lstText[i]) [error] --- Traceback --- end -- I suppose this is a stupid problem from my side, but once obtained the list of matches (as per the docs), how can I extract the strings in it? Thanks for support After having set the options (also smallfont)I print them and these are: OCR.Options: data = C:\Users\Myself\AppData\Roaming\Sikulix\SikulixTesseract\tessdata language(eng) oem(3) psm(6) height(10,0) factor(3,00) dpi(96) variables: user_defined_dpi:300 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #683846]: [1.1.4] PyCharm: running a script: getBundleFolder() seems to return None
Question #683846 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/683846 matteoa posted a new comment: hello, I tried your workaround but there were an error: Traceback (most recent call last): File "MYPerfectlyWorkingScript.py", line 95, in scriptFile = argv[0] # Python standard behavior NameError: name 'argv' is not defined Picked up _JAVA_OPTIONS: -Xmx1024M Process finished with exit code -1 I solved it by using sys.argv[0], thanks! The little problem remaining is that within the IDE "my old version" works, and also using PyCharm works well, but only with older version of SikulixAPI, but it is something we can overcome until fixing. Thanks for your, usual and very rare, prompt support!!! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #684964]: OCR: setPSM with 0, 1, 12 are crashing --- OSD is not supported
Question #684964 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/684964 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #684964]: OCR: setPSM with 0, 1, 12 are crashing --- OSD is not supported
Question #684964 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/684964 matteoa posted a new comment: Hello, the script I've done was because for some image class I had some OCR problem with the default setting and I did not know which was the best PSM setting, this one was a script used to find the best PSM setting and then apply it to the "real" script... Thanks for information! Now it works Thanks for prompt support! BTW I modified the script, i paste it in case it would be helpful for someone: textOCR = TextOCR.start() i=0 img=selectRegion() listOfSetting=[2,3,4,5,6,7,8,9,10,11,13] iIdx=0 for i in range (0,11): #while i<14: textOCR.setPSM(listOfSetting[i]) print "Setting="+str(listOfSetting[i]) +", text=" +"\n" + img.text().encode('utf-8') i=i+1 textOCR.setPSM(3)#return to default -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #683846]: [1.1.4] PyCharm: running a script: getBundleFolder() seems to return None
Question #683846 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/683846 Status: Needs information => Open matteoa gave more information on the question: Hello, the Jython error is not the object of my question, the problem is that I'm not able to debug in Pycharm with latest versions. I have saved a version from April that is in use when we have to debug line by line and works, but the latest builds have the error described above: Traceback (most recent call last): File "MYPerfectlyWorkingScript.py", line 75, in Debug.setUserLogFile(b + 'logs\\' + str(strLogName)) TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' Picked up _JAVA_OPTIONS: -Xmx1024M Process finished with exit code -1 this is the piece of code executed at the very beginning of the script: b=getBundleFolder() strLogName=datetime.now().strftime('%Y%m%d_%H%M%S'+ "-DbgSiK.log") Debug.setUserLogFile(b + 'logs\\' + str(strLogName)) The problem of the Python dll is still there but, so far, I'm able to use Jython 2.7.0 and I think is something related to my pc (a colleague of mine uses 2.7.1) Thanks for support Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #684964]: textOCR.setPSM crashing
New question #684964 on Sikuli: https://answers.launchpad.net/sikuli/+question/684964 Hello all, with last version of Sikulix : 1.1.4-SNAPSHOT-#393-2019-10-10_16:07/Windows10.0/Java8(64)1.8.0_221-b27 When I try to run this script (that is used t find the best OCR setting for an image): textOCR = TextOCR.start() i=0 img=selectRegion() while i<14: textOCR.setPSM(i) print "i="+str(i) +", text=" +"\n" + img.text().encode('utf-8') i=i+1 textOCR.setPSM(3)#return to default I have this error: [error] script [ OcrSettingTEst ] stopped with error in line 6 [error] org.sikuli.script.SikuliXception ( org.sikuli.script.SikuliXception: fatal: TextRecognizer: setPSM(0): needs OSD, but no osd.traineddata found in tessdata folder ) [error] --- Traceback --- error source first line: module ( function ) statement 6: main ( ) textOCR.setPSM(i) [error] --- Traceback --- end -- I tested with a rather old version: 1.1.4-SNAPSHOT-#287-2019-04-18_07:09/Windows10.0/Java8(64)1.8.0_221-b27 On the same script and image and the output is as expected (text extracted from the image with all the 13 different settings. Between switching between the version I deleted the c:\Users\Myself\AppData\Roaming\Sikulix folder just to avoid doubts and used Jythonb 2.7.1 standalone Any hint to overcome this problem? Thanks in advance! Matteo P.s BTW, the current version of tesseract inside Sikulix is 3 or 4? ...I found this in the file versionchanges.txt of the downloaded package: Version 4.4.0 (13 July 2019) - Upgrade to Tesseract 4.1.0 (5280bbc) - Upgrade to Leptonica 1.78.0 (lept4j-1.12.2) - Update dependencies -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #683846]: [1.1.4] PyCharm: running a script: getBundleFolder() seems to return None
Question #683846 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/683846 Status: Answered => Open matteoa is still having a problem: Hi RaiMan, any news regarding this problem? In the meantime a colleague of mine has installed everything and this problem is present also in his pc. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #683846]: [1.1.4] PyCharm: running a script: getBundleFolder() seems to return None
Question #683846 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/683846 matteoa gave more information on the question: Hi all, I'm sorry, in the previous message I said something wrong, it was only a misconfiguration of the Pycharm, now it has exactly the same error of before with current Sikulix 1.1.4 version... -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #683846]: [1.1.4] PyCharm: running a script: getBundleFolder() seems to return None
Question #683846 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/683846 matteoa gave more information on the question: with the last version I have another error message when trying to run a script that works if launched from the IDE or from command line: C:\jython2.7.0\bin\jython.exe -Dpython.path=C:\SikuliX\Test_h20\PSA_Id_direct.sikuli C:/PSA_Id_direct.sikuli C:\jython2.7.0\bin\jython.exe: No module named __main__ Picked up _JAVA_OPTIONS: -Xmx1024M Process finished with exit code 1 This is the version I've used today: 1.1.4-SNAPSHOT-#383-2019-09-26_13:41/Windows10.0/Java8(64)1.8.0_221-b27 Thanks in advance -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #683846]: [1.1.4] PyCharm: running a script: getBundleFolder() seems to return None
Question #683846 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/683846 Status: Answered => Open matteoa is still having a problem: Hello, any news regarding this problem? -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #683846]: [1.1.4] PyCharm: running a script: getBundleFolder() seems to return None
Question #683846 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/683846 matteoa posted a new comment: hello RaiMan, I installed Jython 2.7.1 but at the time of setting it up with Pycharm as project interpreter having selected c:\jython2.7.1\bin\jython.exe It shows me an error that I'm not expert enough in Python nor in PyCharm to solve: executed command: C:\Program Files\JetBrains\PyCharm Community Edition 2018.2.4\helpers\packaging_tool.py untar C:\Program Files\JetBrains\PyCharm Community Edition 2018.2.4\helpers\virtualenv-16.0.0.tar.gz error occurred: Non-zero exit code (-1) command output: Error loading Python DLL: C:\jython2.7.1\bin\python27.dll (error code 14001) I retried this today but I remember I did that a lot of time ago with the same result...so I used (only for for Pycharm) 2.7.0...while using the standalone version for Sikulix...a little a mess, I know, but until today it was working... I tried also to use the standalone version of the Thanks a lot for your support, superprompt as usual!! Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #683846]: PyCharm run/Debug stopped working with newer version
New question #683846 on Sikuli: https://answers.launchpad.net/sikuli/+question/683846 hello all, I've been using Sikulix via PyCharm for months for debug, running from it etc etc etc, no problem, a pleasure to use. This morning I updated sikulix+API with latest version and when I try to run the project that was running before I have this error message: Traceback (most recent call last): File "MYPerfectlyWorkingScript.py", line 75, in Debug.setUserLogFile(b + 'logs\\' + str(strLogName)) TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' Picked up _JAVA_OPTIONS: -Xmx1024M Process finished with exit code -1 this is the piece of code executed at the very beginning of the script: b=getBundleFolder() strLogName=datetime.now().strftime('%Y%m%d_%H%M%S'+ "-DbgSiK.log") Debug.setUserLogFile(b + 'logs\\' + str(strLogName)) Any idea about what gone wrong? In the meantime I did nothing with the project but I can remind that there were an automatic update of the JVM. Thanks for any help Matteo this is my Sikulix configuration: 1.1.4-SNAPSHOT-#378-2019-09-05_08:05/Windows10.0/Java8(64)1.8.0_221-b27 and this is the PyCharm one: PyCharm 2018.2.4 (Community Edition) Build #PC-182.4505.26, built on September 19, 2018 JRE: 1.8.0_152-release-1248-b8 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #683695]: is possible to open ide via command line with a specific script open?
New question #683695 on Sikuli: https://answers.launchpad.net/sikuli/+question/683695 Hello, I' like to know if there are some command line option that will cause the opening of the ide with a specific script shown, without running it. I've been looking in the command line options and trying by myself and it seems that the script shown on the ide is ruled by the last edited script. Thanks for help! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #681769]: How to continue from FindFailed exception using Selenium and Java
Question #681769 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/681769 Status: Open => Answered matteoa proposed the following answer: Hello, I hope this response can help you: https://answers.launchpad.net/sikuli/+question/680899 It is related to the python scripting but I think the same APIs exists also in JAva -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #681509]: Click does not work
Question #681509 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/681509 matteoa posted a new comment: Hello,we are running more or less the same setup with ultravnc. We are having the same problems of missing clicks after thousands of cycles; something that mitigate the problem is to force a refresh of ultravnc...I think that this way maybe Ultravnc sends the click that was done but not received/sent. I also tried with some success to change a click with a doubleclick... Anyway the problem is still there, mitigated but... -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #681484]: "what's new" in nigthly builds is present?
Question #681484 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/681484 matteoa posted a new comment: Hello RaiMan, that link is for sure useful, but is not what I was wishing to have...it is the same for all the 1.1.4 releases that are an huge number... I'd like to have the information if it's worth the effort to update what we have in production, that is version 1.1.4, so for example "fixed bug 123, improved speed and reliability of function XY" and so on... Maybe something close to the comment in committing changes could work. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #676086]: Ocr not always working
Question #676086 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/676086 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #680190]: addImagePath working on a Pc and not in another
Question #680190 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680190 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #681484]: "what's new" in nigthly builds is present?
New question #681484 on Sikuli: https://answers.launchpad.net/sikuli/+question/681484 Hello, would be helpful to have a "what's new" short description for the Sikulix releases.. If I'm not wrong there is only the link to "Things that have been fixed" that goes to a list of bugfix committed that is not what I'd need. For example for the 2019-06-18_12:08 (Build 309) between the "Things that have been fixed" there is this bugfix: #1741764 [1.1.4] ADBScreen - crashes if waitAfterAction set to 0 --- fixed 2018-12-12 build #145 committed with a version from 2018. A list of new features introduced would help a lot... Being here I'd also dare to ask for a documentation update notification...it has happened to discover by chance some interesting information... Thanks for your work! Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #680899]: [1.1.4] Global FindFailed handler: how to use in python scripting
Question #680899 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680899 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #680899]: [1.1.4] Global FindFailed handler: how to use in python scripting
Question #680899 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680899 matteoa posted a new comment: Thank you Raiman! no being an experienced Python developer I've always the doubt of being me the problem... I'll test your solution ASAP. Let us know the proceedings! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #680899]: how to recover from crashing of target application?
Question #680899 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680899 matteoa posted a new comment: Hello Raiman, yes, these two questions were related...In case for the findfailed nobody offered the solution I asked for another way to accomplish the same... Let me add some maybe interesting detail: my script first starts an external VNC app (ultravnc) then takes the application region of the window as ROi for all the subsequent operations. Just after having created the region vncReg the code is as follows: appVNC= App(getParentFolder() + r'UltraVNC\vncviewer.exe') if not appVNC.isRunning(0): appVNC.open(0) appVNC.focus() vncReg=appVNC.focusedWindow() FindFailed.setHandler(HndlFindFailed) setROI(vncReg.getX(),vncReg.getY(),vncReg.getW(),vncReg.getH()) use() # reset the global SCREEN object to take over the handler setting Thanks! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #680899]: how to recover from crashing of target application?
New question #680899 on Sikuli: https://answers.launchpad.net/sikuli/+question/680899 Hello all, I'm automating an application that from time to time have a couple of component (not under our control) that crashes with the usual window: "the application pippo.exe has stopped working" and so on. These crashes appears at random moment, not always in the same phase/window. The automation script is a state machine that in these cases simply is not able to find the image it was waiting or looking for, so throw exception and exits. I've ready a sikulix procedure to recover from these cases but I'm not able to call this procedure for any phase it may happen. I'd like to avoid to put try except for all the images search wait etcetc There is another way to accomplish this use case? Thanks in advance Matteo P.s. my configuration: 1.1.4-SNAPSHOT-#287-2019-04-18_07:09/Windows10.0/Java8(64)1.8.0_201-b09 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #680596]: FindFailed.setHandler not firing
Question #680596 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680596 matteoa posted a new comment: hello, no solution for this? There are alternatives for a global findfailed handler? Thanks in advance -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #680596]: FindFailed.setHandler not firing
New question #680596 on Sikuli: https://answers.launchpad.net/sikuli/+question/680596 hello all, I have a script with these lines: setROI(vncReg.getX(),vncReg.getY(),vncReg.getW(),vncReg.getH()) FindFailed.setHandler(HndlFindFailed) use() # reset the global SCREEN object to take over the handler setting what happens is that the handler is not visited even if in the vncReg there is a findfailed for some reason. Any idea why? I've checked https://answers.launchpad.net/sikuli/+question/670456 but found no clue thanks in advance for help this is my setup: 1.1.4-SNAPSHOT-#287-2019-04-18_07:09/Windows10.0/Java8(64)1.8.0_201-b09 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #679017]: Vnc app detected only at first attempt after Sikulix Ide launch
Question #679017 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/679017 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #680190]: addImagePath working on a Pc and not in another
Question #680190 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680190 matteoa posted a new comment: Thanks RainMan! Yes, I was supposing that the base folder was the working folder, I tried on my pc and it was ok, then I went to the production pc and... Let me know Thanks again for your prompt support! P.s. the reason for which I'm not using the last version is described in question here: https://answers.launchpad.net/sikuli/+question/679017 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #680190]: addImagePath working on a Pc and not in another
Question #680190 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/680190 matteoa gave more information on the question: Hello all, I solved the problem by using this: p=getParentPath()+r"\ECUImg" addImagePath(p) It works on both pc. I'm ok now, but I think the problem I had is worth an explanation. Thanks in advance Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #680190]: addImagePath working on a Pc and not in another
New question #680190 on Sikuli: https://answers.launchpad.net/sikuli/+question/680190 Hi, on my development Pc: 1.1.4-SNAPSHOT-2019-01-30_21:31/Windows10.0/Java8(64)1.8.0_201-b09 I have a folder at the same level of the .sikuli folder that contains my script that contains a set of images. To access them I have put this in the script: addImagePath(r"..\ECUImg") And it works perfectly. In the "production" pc : 1.1.4-SNAPSHOT-2019-01-30_21:31/Windows6.1/Java8(64)1.8.0_201-b09 i run the same script in a different location, but always with the Image repository folder at the same level of the script, and I have: [error] ImagePath: add: not valid: ..\ECUImg I tested using absolute path instead of absolute and it worked well, so I suppose access right et cetc are ok but I'd like to remain "relocatable"... TO eliminate some possibilities, in both pc the folder exists, withouth spaces in path and are writable by everybody. Any idea? Thanks in advance P.s. I'm currently not using the last version of Sikulix since I have a problem with newer versions of it. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #679017]: Vnc app detected only at first attempt after Sikulix Ide launch
Question #679017 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/679017 matteoa posted a new comment: hello, no hopes for a fix for this problem? Not a blocking one, but it would be nice to overcome it... Thanks Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #678997]: Not find exception thrown unexpectedly
Question #678997 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678997 matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #678997]: Not find exception thrown unexpectedly
Question #678997 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678997 Status: Answered => Solved matteoa confirmed that the question is solved: hello, thanks for support, I put your code on operation and it works. About the MouseMove we found that, possibly because we are using a VNC app to mirror the screen of the application we want to automate, the cursor is visible in the screenshot. Thanks a lot! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #679017]: Vnc app detected only at first attempt after Sikulix Ide launch
Question #679017 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/679017 matteoa gave more information on the question: Just a small addition: with the older version of Sikulix I have the second test script never has problems, even if Notepad++ is closed. I hope this helps... Thanks again Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #679017]: Vnc app detected only at first attempt after Sikulix Ide launch
Question #679017 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/679017 Status: Answered => Open matteoa is still having a problem: I reproduced the problem with this script(Notepad++ was closed before the launch): chrExe = r"c:\Program Files (x86)\Notepad++\notepad++.exe" app = App(chrExe) if not app.isRunning(): app.open(10) vncReg=Region(app.window()) print app, app.window() The error is on the line5 : vncReg=Region(app.window()) and the output is [error] script [ testapp2 ] stopped with error at line --unknown-- [error] Error caused by: Traceback (most recent call last): File "C:\Projects\DataPurchase\REACT\SikuliX\Test_h20\testapp2.sikuli\testapp2.py", line 5, in vncReg=Region(app.window()) at org.sikuli.script.Region.(Region.java:414) at org.python.proxies.sikuli.Region$Region$5.(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.python.core.PyReflectedConstructor.constructProxy(PyReflectedConstructor.java:211) java.lang.NullPointerException: java.lang.NullPointerException When Notepad++ is already opened the script works repeatedly. The original script I put on this question was working without problem from months, and using an older version of Sikulix still works every time. Is it possible that in the newer versions there is something different to do to grab the region of an application and use it as a ROI for all the subsequent operations? Thanks for your invaluable support Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #679017]: Vnc app detected only at first attempt after Sikulix Ide launch
New question #679017 on Sikuli: https://answers.launchpad.net/sikuli/+question/679017 Hello, I'm automating using a UltraVNC external app, and for that I have this script: appVNC= App(getParentFolder() + r'UltraVNC\vncviewer.exe') if not appVNC.isRunning(0): appVNC.open(0) print appVNC if not(appVNC.isRunning(5)): LogAll('VNC_NOT STARTED') exit(-1) appVNC.focus() vncReg=Region(appVNC.window()) With version 1.1.4-SNAPSHOT-#223-2019-03-06_14:23/Windows10.0/Java8(64)1.8.0_191-b12 it runs ok and finish correctly only at first attempt. When I try to relaunch it without closing the IDE it has an exception at line 8: error] script [ testApp ] stopped with error at line --unknown-- [error] Error caused by: Traceback (most recent call last): File "\testApp.sikuli\testApp.py", line 8, in vncReg=Region(appVNC.window()) at org.sikuli.script.Region.(Region.java:414) at org.python.proxies.sikuli.Region$Region$5.(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.python.core.PyReflectedConstructor.constructProxy(PyReflectedConstructor.java:211) java.lang.NullPointerException: java.lang.NullPointerException The same behavior can be see using Pycharm, to make it work I have to close the project and restart the IDE Using an older version I had by mistake 1.1.4-SNAPSHOT-2019-01-30_21:31/Windows10.0/Java8(64)1.8.0_191-b12 It runs correctly every time, as it was doing from months Let me know if I can help you more on understanding the problem Thanks in advance -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #678997]: Not find exception thrown unexpectedly
New question #678997 on Sikuli: https://answers.launchpad.net/sikuli/+question/678997 Hello, I'm using 1.1.4-SNAPSHOT-#221-2019-03-05_11:49/Windows10.0/Java8(64)1.8.0_191-b12 I have to click on a button, that will cause the visible page to change making appearing FirstElementOfNewPage.png, from then the script goes on. Sometimes (~2% of cases) the target application doesn't reacts to the first click (Settings.MoveMouseDelay=0.1) and so the FirstElementOfNewPage.png doesn't appears, my idea would be in these cases to reclick on the same button and retry the search for FirstElementOfNewPage.png. I have a script like this one: try: click("ChangePageButton.png")#first try mouseMove(100, 100) #this is present to move the mouse cursor from the button and allow a better finding of the button for second try wait ("FirstElementOfNewPage.png",30) except: click("ChangePageButton.png")#retry wait ("FirstElementOfNewPage.png",30) What happens is that the script goes in the except part 80-90% of the times, also when the situation is completely ok (i.e. FirstElementOfNewPage.png is well visible). Prior that introducing the try-except the script was working rather well with a notFound problem every ~50 attempts. I was wondering if the wait (or MouseMove) operation could trigger somehowthe exception. Thanks for help! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #678995]: [1.1.4] IDE: screens seen by sikulix when changing attached monitors --- restart IDE
Question #678995 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678995 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #678995]: screen seen by sikulix varies when changing attached monitors
New question #678995 on Sikuli: https://answers.launchpad.net/sikuli/+question/678995 Hello, I'm using 1.1.4-SNAPSHOT-#221-2019-03-05_11:49/Windows10.0/Java8(64)1.8.0_191-b12 I run and program it in a portable pc that is normally attached to a secondary screen I routinely have the need to change the monitor to connect to another monitor with a different resolution. I observed that when doing this Sikulix often seem as if it doesn't take into account the change of resolution of the monitor, and so sometime cuts the lower part of the screen (seen with matching preview of an image or capturing something from the screen) or see everything magnified. When "seeing" the screen like this the scripts the parts that looks for images to click etcetc doesn't work anymore...causing some problem when demonstrating something to the bosses...;-) Restarting the pc fixes everything. There is a way to refresh the screen resolution seen by Sikulix and sikulix IDE without restarting the pc? Thanks for the support and for your wonderful tool!! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #678051]: returning from included sikulix script changes screen(0)
Question #678051 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/678051 Status: Open => Solved matteoa confirmed that the question is solved: Hello, this problem is not real: I solved the problem by noticing that there was another occurrence of the searched image in another independent position that was not human visible(quickly disappearing), but it was for the powerful eyes of Sikulix... -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #678051]: returning from included sikulix script changes screen(0)
New question #678051 on Sikuli: https://answers.launchpad.net/sikuli/+question/678051 hello, I'm running a sikulix script (below) that is calling another sikulix script, and it does what is is supposed to do (searching for images, clicking, typing), but when returning it seems to change the place where the mother scripts finds images. What is happening is a problem later in the mother script in a part that prior than the introduction of this call (before it was a piece of the mother script) was working: I look for an image, then I move and resize the region obtained, then I use this region as a ROI for following searches (the idea was to speedup a search that was rather lenghty) With the included script the image is found, but the position in which it has been found is about 200pixels right and 50 pixel down of the actual position of the image, so it doesn't found what it was supposed to find. I found that by highlighting the regions, see below. Since the position of the whole app that contains the image can change I'd like not to add absolute coodinates, but what I do usually is to find a fixed piece of the app and then using coodinates relative to this piece. The question is: where is the problem in the included script? This is the part of the Mother script that calls the included one: import includedScript ... listPar=includedScript.CalledFunct() numWheelClick= listPar[0] ... This is the part of the mother script that fails: rReg=find("1548174728109.png") rReg.highlight(2) rReg.y=rReg.y+3*rReg.h rReg.w=280 rReg.h= 500 rReg.highlight(2) The called script has a single function: def CalledFunct (regToActOnReg= Screen(0)): regToActOnReg.mouseMove("1539092727144.png") regToActOnReg.click("1538572839311.png") regToActOnReg.wait("1547825730701.png", 15) regToActOnReg.type(Pattern("1547825730701.png")),"vf311" + Key.ENTER) retList=[] retList.append(12) retList.append("1539608590023.png") return(retList) -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #677916]: Script Exception after region highlight
Question #677916 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/677916 matteoa confirmed that the question is solved: Thanks masuo, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #677916]: Script Exception after region highlight
Question #677916 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/677916 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks a lot! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #677916]: Script Exception after region highlight
Question #677916 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/677916 Description changed to: Hello all, With the script below (a part of a much longer script), after "vncReg.highlight(2)" I have this error: [error] Error caused by: Traceback (most recent call last): File "c:\TEstBug.sikuli\TEstBug.py", line 4, in vncReg.highlight(2) AttributeError: 'org.sikuli.script.Region' object has no attribute '__exit__' That I had not with older versions of Sikulix. This happens with running inside the IDE and from Pycharm, no differences in error messages How could I fix this error? My environment is : 1.1.4-SNAPSHOT-2019-01-16_07:30/Windows10.0/Java8(64)1.8.0_191-b12 Thanks in advance This is the minimum script to show the error, the images are the connection button and the refresh button of the ultravnc window, line 4 mentioned in the error message is "vncReg.highlight(2)" appVNC= App(r'"c:\UltraVNC\vncviewer.exe"') appVNC.open(0) vncReg=appVNC.focusedWindow() vncReg.highlight(2) with vncReg: click("1544788207679.png") and this is the full console output: [log] highlight R[773,299 374x401]@S(0) for 2.0 secs [error] script [ TEstBug ] stopped with error at line --unknown-- [error] Error caused by: Traceback (most recent call last): File "C:\Projects\DataPurchase\REACT\SikuliX\Test_h20\TEstBug.sikuli\TEstBug.py", line 4, in vncReg.highlight(2) AttributeError: 'org.sikuli.script.Region' object has no attribute '__exit__' 1.1.4-SNAPSHOT-2018-12-31_16:24/Windows10.0/Java8(64)1.8.0_191-b12 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #677916]: Script Exception after region highlight
Question #677916 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/677916 matteoa gave more information on the question: shorter version of the script, I don't think I could restrict it more, same error message shown: appVNC= App(r'"c:\Projects\DataPurchase\REACT\SikuliX\Test_h20\UltraVNC\vncviewer.exe"') appVNC.open(0) vncReg=appVNC.focusedWindow() vncReg.highlight(2) with vncReg: click("1544788207679.png") -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #677916]: Script Exception after region highlight
New question #677916 on Sikuli: https://answers.launchpad.net/sikuli/+question/677916 Hello all, With the script below (a part of a much longer script), after "vncReg.highlight(2)" I have this error: [error] Error caused by: Traceback (most recent call last): File "c:\TEstBug.sikuli\TEstBug.py", line 21, in vncReg.highlight(2) AttributeError: 'org.sikuli.script.Region' object has no attribute '__exit__' That I had not with previous versions of Sikulix. This happens with running inside the IDE and from Pycharm, no differences in error messages How could I fix this error? My environment is : 1.1.4-SNAPSHOT-2019-01-16_07:30/Windows10.0/Java8(64)1.8.0_191-b12 Thanks in advance This is the minimum script to show the error, the images are the connection button and the refresh button of the ultravnc window, line 21 mentioned in the error message is "vncReg.highlight(2)" # !/usr/bin/env python # -*- coding: utf-8 -*- import org.sikuli.script.SikulixForJython from sikuli import * appVNC= App(r'"c:\UltraVNC\vncviewer.exe"') appVNC.open(0) print appVNC if not(appVNC.isRunning(5)): exit(-1) appVNC.focus() vncReg=Region(appVNC.window()) with Region(vncReg): click("1544628503735-1.png") wait(2) vncReg=appVNC.focusedWindow() vncReg.highlight(2) with vncReg: click("1544788207679.png") and this is the full console output: [-1:vncviewer (???)] c:\UltraVNC\vncviewer.exe [log] CLICK on L[1104,399]@S(0) (534 msec) [log] highlight R[781,438 357x123]@S(0) for 2.0 secs [error] script [ TEstBug ] stopped with error at line --unknown-- [error] Error caused by: Traceback (most recent call last): File "C:\Projects\DataPurchase\REACT\SikuliX\Test_h20\TEstBug.sikuli\TEstBug.py", line 20, in vncReg.highlight(2) AttributeError: 'org.sikuli.script.Region' object has no attribute '__exit__' -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #677266]: Sikulix IDE not closing his process with nightly build SNAPSHOT-2018-12-31
Question #677266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/677266 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #677266]: Sikulix IDE not closing his process with nightly build SNAPSHOT-2018-12-31
New question #677266 on Sikuli: https://answers.launchpad.net/sikuli/+question/677266 hello, I downloaded today the nightly build, porting my configuration to 1.1.4-SNAPSHOT-2018-12-31_16:24/Windows10.0/Java8(64)1.8.0_191-b12 >From today, and not with previous version from the 14th of december (I think, >maybe even with 20th december version), when I close the IDE even without >launching any script it is no more possible to launch it again without >manually killing the javaw.exe process and his descendants (java.exe and >conhost.exe). The error message is "terminating: IDE already running" and after the close of this messagebox another triplet of jawaw, java and conhost remains running. Any Idea on how to fix this? Thanks in advance Regards -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #676618]: Pycharm Sikulix Script warning Starting message
Question #676618 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/676618 Status: Needs information => Open matteoa gave more information on the question: Hello RaiMan, this is my setup: 1.1.4-SNAPSHOT-2018-12-03_15:24/Windows10.0/Java8(64)1.8.0_191-b12 Yes, I have a laptop+an external monitor, I just made a test with only the embedded monitor and the messages are only the expected ones. Since using two monitor makes me work better, and that I do not have any real problem(i.e. the script works), if in your opinion is only a matter of additional warning message I'll continue with my setup. Else I'll see what to do...Running the same script from within Sikulix IDE these message are not there. Thanks a lot for your prompt support Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #676618]: Pycharm Sikulix Script warning Starting message
New question #676618 on Sikuli: https://answers.launchpad.net/sikuli/+question/676618 Hello, after managing to configure Pycharm, with the instruction together with the clearing of the /Sikulix/Lib. to test it I wrote a very simple script: import org.sikuli.script.SikulixForJython from sikuli import * print("hello") popup("hello world") exit(0) That works. When I launch the script from within PyCharm I have the message below(including expected "hello" and exit), I tried to start Pycharm as an administrator without any change. Not a blocking problem, so far. Thanks for info Matteo \jython2.7.0\bin\jython.exe -Dpython.path=C:\TEst\Pycharm C:/TEst/Pycharm/helloworld.py [error] RobotDesktop: checkMousePosition: should be L(-1152,432)@S(1)[-1920,0 1536x864] but after move is L(-1306,346)@S(1)[-1920,0 1536x864] Possible cause in case you did not touch the mouse while script was running: Mouse actions are blocked generally or by the frontmost application. You might try to run the SikuliX stuff as admin. [error] RobotDesktop: checkMousePosition: should be L(1555,91)@S(0)[0,0 1920x1080] but after move is L(1919,113)@S(0)[0,0 1920x1080] Possible cause in case you did not touch the mouse while script was running: Mouse actions are blocked generally or by the frontmost application. You might try to run the SikuliX stuff as admin. hello Process finished with exit code 0 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #676086]: Ocr not always working
Question #676086 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/676086 matteoa posted a new comment: Hello, I fully understand that you cannot support old versions, no problem at all. But, since now I'm using 1.1.4 with VNC connection to the old 32 bit pc...I make some more question...there are experiences of using syntax correction and/or specialized vocabulary with the ocr feature of Sikulix 1.1.4? if so, which is the libraries tested? Thanks Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #676086]: Ocr not always working
Question #676086 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/676086 matteoa posted a new comment: Thanks for clarification! I managed to switch to Sikulix 1.1.4, using VNC and screenshot taken by sikulix 1.1.3 and moving the images on a more modern pc, but with not a lot of better results. The complete testing script I'm using is this one: img1 = Image.create(capture(selectRegion())) imgGreyResized = Image(Image(Image.convertImageToGrayscale(img1.get())).resize(3)) print imgGreyResized.text().encode('utf-8') But the OCR results are not so good, the "Yes" is found as "YE!" and "NO" as "IND", or something like, sometimes it also works. I also tried with resize(5) or 8, but saw no differences. I was thinking about binarizing the image to 2 colors only with nearest neighbour algorithm, any suggestion? Tesseract does it internally, I think, but maybe I could use a more specific algorithm for web pages. There is the possibility to add a vocabulary of words to be used in a particular situation to the tesseract engine? I'm thinking about a command to tell to tesseract "here there are numbers", "here there could be only yes or no" and so on.. Thanks for your, as usual, great support -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #676086]: Ocr not always working
Question #676086 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/676086 Status: Answered => Open matteoa is still having a problem: Thanks RaiMan, I've tried this, merging together the two above mentioned answers : img1 = Image.create(capture(selectRegion())) imgGrey = Image.convertImageToGrayscale(img1.get()) imgGreyResized = Image.resize(imgGrey, 3) print imgGreyResized().text() But I have had this error: [error] Error caused by: Traceback (most recent call last): File "C:\Projects\DataPurchase\REACT\SikuliX\Test_h20\interactTextBetter.sikuli\interactTextBetter.py", line 3, in imgGreyResized = Image.resize(imgGrey, 3) TypeError: resize(): self arg can't be coerced to org.sikuli.script.Image It is not clear to me if when you say that these are static methods you mean of Java or python: if Java I've checked this: https://docs.oracle.com/javase/7/docs/api/java/awt/Image.html and I did not find the image.resize method. If Python I found here: https://python.developpez.com/cours/pilhandbook/php/image.php The resize method, but it says that there are two calls possible: resize im.resize(size) => image im.resize(size, filter) => image In your 271593 response do you mean that what is needed is to do something like: imgGreyResized = Image.resize(float(imgGrey[0])*3.0, float(imgGrey[1])*3.0)) ? Because I tried and have had this error: line 4, in imgGreyResized = Image.resize(imgGrey[0]*3, imgGrey[1]*3) TypeError: 'java.awt.image.BufferedImage' object is unsubscriptable then I tried also this line: imgGreyResized = Image.resize(imgGrey.getHeight()*3, imgGrey.getWidth()*3) With this error: line 5, in imgGreyResized = Image.resize(imgGrey.getHeight()*3, imgGrey.getWidth()*3) TypeError: resize(): self arg can't be coerced to org.sikuli.script.Image It is probably a stupid error from my side...thanks for any help! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #676200]: IDE: Windows: Problem when trying to invoke menu action doFind (ctrl + f)
Question #676200 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/676200 matteoa confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #676200]: [error] IDE: Problem when trying to invoke menu action doFind Error: null
Question #676200 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/676200 Status: Needs information => Open matteoa gave more information on the question: I think I'm using the version that can be downloaded form the official download page: https://raiman.github.io/SikuliX1/downloads.html This version was built at 2018-10-31_16:29 (Build 129) How could I take the newer version? How can be read the build number of the version I'm using? Thanks in advance -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #676200]: [error] IDE: Problem when trying to invoke menu action doFind Error: null
New question #676200 on Sikuli: https://answers.launchpad.net/sikuli/+question/676200 Hello, I have the message in Sikulix 1.1.4 when I press ctrl+f to find in the scripts. It is not a blocking problem, but how could I fix it? Thanks in advance for support -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #676086]: Ocr not always working
New question #676086 on Sikuli: https://answers.launchpad.net/sikuli/+question/676086 Hello, since I have to use Sikulix on a 32bit pc I'm stuck with version 1.1.3. I have a bar in a web app where I have to read with ocr two items, so the font, the background the size etc are the same. What I do in the script is to select the two regions and then do the OCr one after the other(but changing the order doesn't affect the (bad) results. The bar I' working on is something like (the "yes" is actually what I have to Ocr): -- Everything is ok? Yes -- The OCR of the left phrase works perfectly, while in the right part it read nothing (instead of "Yes"). I tried with this single line script(question 674899): print selectRegion().text() And the results are consistent, the ocr on the right of the bar is always found with no problem, while in the left part found nothing. The real images are available, if needed. I tried also the advises in question 271593 but I do not manage to make it run in Sikulix IDE, with these lines: img = capture(rValAV) # get the image from the screen (in memory) img1 = Image.create(img) # create an with the new Image class (still in memory) imgGrey = img1.convertImageToGrayscale(img1.get()) # does what it says (still in memory) imgGreyResized = imgGrey.resize(3) # resize the image to about 300dpi (usually 3 as factor is sufficient) (still in memory) text = imgGreyResized.text() # using the SikuliX builtin OCR implementation print text the error given is: ... line 113, in imgGreyResized = imgGrey.resize(3) # resize the image to about 300dpi (usually 3 as factor is sufficient) (still in memory) AttributeError: 'java.awt.image.BufferedImage' object has no attribute 'resize' ... Since in the right part the Tesseract works perfectly I suppose there is something wrong with what I do. I'm sorry if I did some beginner mistake... Thanks for any help -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #675958]: How to implement a watchdog timer?
Question #675958 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/675958 matteoa posted a new comment: Thanks a lot Masuo! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #675958]: How to implement a watchdog timer?
Question #675958 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/675958 Status: Answered => Solved matteoa confirmed that the question is solved: Thanks masuo, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #675958]: How to implement a watchdog timer?
Question #675958 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/675958 Status: Answered => Open matteoa is still having a problem: Hello Masuo, thanks a lot for helping. I tried to copy and paste your script directly in the 1.1.4 ide and run from there. It closes the ide, and the java process that's running it. I was expecting that the Ide wouldn't be closed What I did wrong? Thanks in advance Matteo I added some debug to understand better: import thread b=getBundleFolder() Debug.setUserLogFile(b + "DebugSikuliX.log") Debug.user('getBundleFolder='+ b) #-count down and type hotkey def Type_Hotkey(name,*args): Debug.user('Type_Hotkey='+ name) cnt = args[0] while cnt > 0: cnt = cnt - 1 sleep(1) type(Key.END,Key.CTRL) #type hotkey #-hotkey handler def Exit_Main(event): Debug.user('Exit_Main') type(Key.CTRL) #dummy type to cancel CTRL exit() #-Main script Debug.user('Start') Env.addHotkey(Key.END, KeyModifier.CTRL, Exit_Main) duration = 5 thread.start_new_thread(Type_Hotkey,("Type_Hotkey",duration)) Debug.user('start_new_thread') while True: sleep(1) Debug.user('Stop') And this is the content of the corresponding debug file: [user (06/11/18 11.23.35)] getBundleFolder=C:\TEst\sikulix\watchdogExample.sikuli\ [user (06/11/18 11.23.35)] Start [user (06/11/18 11.23.35)] start_new_thread [user (06/11/18 11.23.35)] Type_Hotkey=Type_Hotkey [user (06/11/18 11.23.40)] Exit_Main -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #675958]: How to implement a watchdog timer?
New question #675958 on Sikuli: https://answers.launchpad.net/sikuli/+question/675958 hello all, I have a Sikulix script that automate a sw that sometimes hangs or behave in unusual ways. So far the script sometimes waits for the appearance of an image and if the image doesn't appears it remains like "stuck" and I have to stop the java process. I'd like to implement a watchdog timer that when the internal status of the script is not updated for some time closes the script(or tries workaround). I've checked on the net some options, like to put all the code in a try catch and then from a timer in a different thread raise an exception but I'd like to have something that doesn't force me to include all the script in such clauses. Any idea? Thanks for support and "have nice vacations to Raiman!" Matteo -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp