Re: [Sikuli-driver] [Question #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 Status: Answered => Solved Sander confirmed that the question is solved: Hi Raiman, It works, it does recognise the images :-) For the someImages.sikuli I've removed all import statements The executable script I've used: from someImages import *. (otherwise it is not working) Thanks for the help! I do see see some other issues I have, but I'll raise this in a separate ticket. Thanks for the help! Regards, Sander -- 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 #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 Status: Open => Answered RaiMan proposed the following answer: --1. the main script (the one, that is run) does not need from sikuli import * --2. when using import for the script, that contains the images, then setBundlePath(".../Sikulix/someImages.sikuli") is not needed … an imported script is automatically added to the imagepath --3. a script, that only contains image references like imageXXX = "imageWhatever.png" does not need a from sikuli import * This is only needed in imported scripts, that use SikuliX features. Generally: If you get the error [error] ImportError ( No module named sikuli ) when running a script, then you have to revise your setup. Running a script in a correctly setup SikuliX IDE will never produce such errors. This only happens in setups, where you try to run SikuliX scripts with other means: Jython from commandline, other IDE's like NetBeans/PyDev, PyCharm. -- 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 #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 Status: Answered => Open Sander is still having a problem: Hi Manfred, Thanks for coming back on this. You are correct. That is my mistake editing this answer. But the actual problem is, is that is returns an error for the import. I've tried what Raiman suggested but it gives an: [error] script [ executableTests] stopped with error in line 2 [error] ImportError ( No module named sikuli ) -- #someImages.sikuli from sikuli import * setBundlePath(".../Sikulix/someImages.sikuli") image1 = "image1.png" image2 = "image2.png" than: # executableTests from sikuli import * from someImages import * hover(image1) hover(image2) [...] -- [error] script [ executableTests ] stopped with error in line 2 [error] ImportError ( No module named sikuli ) -- 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 #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 Status: Open => Answered Manfred Hampl proposed the following answer: The lines image1 = image1.png image2 = image2.png are definitely wrong, they have to be image1 = "image1.png" image2 = "image2.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
Re: [Sikuli-driver] [Question #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 Status: Answered => Open Sander is still having a problem: Hi RaiMan, thanks for the prompt reply. Good to know about the goodie, that works perfectly, thanks for that. I prefer to use the variable name (less typing) and looks nice when looking at the script. But it is not working yet, this is what I did: from sikuli import * setBundlePath(".../Sikulix/someImages.sikuli") image1 = image1.png image2 = image2.png than: from sikuli import * from someImages import * hover(image1) hover(image2) -- [error] script [ executableTestsPostNLBagage ] stopped with error in line 2 [error] ImportError ( No module named sikuli ) Hope you could help me with the last bit, cheers! -- 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 #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 RaiMan proposed the following answer: One more thing: I guess you have a Retina display: Do not try to capture images with the Mac capture tool, since they will not work with SikuliX (each pixel is converted to 4 pixels, hence the image has double width and double height). ... always use the SikuliX IDE or the SikuliX capture features programmatically. -- 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 #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 RaiMan proposed the following answer: --- I tried to figure out for view hours how this works ... rather simple: - make a script somewhere and name it e.g. MyImages.sikuli - use the IDE, to capture and name the images - save the script - in your script simply say at the beginning: setBundlePath() For automatic naming of images there is a nice goody in the IDE: - make line like so image1 = - place the cursor somewhere at the end of the line after the = - take a shot the shot will be named image1.png and will keep the same name when recaptured then there are 2 usage scenarios: 1. image path - use setBundlePath() - reference the images as Strings like find("image1") 2. import from MyImages.sikuli import * find(image1) # ref using the assigned variable. ... be careful with possible name clashes - have a naming convention. -- 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 #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 Sander posted a new comment: Thanks RailMan, I'll take a look, yesterday I tried to figure out for view hours how this works, I'll try tonight again, and let you know if I could get it to work. Thanks for pointing this out. Got to go now. macOS rocks! :-) -- 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 #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 Status: Open => Answered RaiMan proposed the following answer: general suggestions: - use 1.1.2 or even 1.1.3 nightly - have a look at the ImagePath feature http://sikulix-2014.readthedocs.io/en/latest/scripting.html#image-search-path-where-sikulix-looks-for-image-files BTW: macOS is my primary work system ;-) -- 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 #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 Status: Needs information => Open Sander gave more information on the question: Hi RailMan, sorry yes, just using my MacBook Pro. (Was already late yesterday evening) :-) If you need more info, please let me know. -- 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 #671266]: creating an image lib
Question #671266 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/671266 Status: Open => Needs information RaiMan requested more information: iOS do you mean macOS? -- 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