Copy string from desktop and use in Sikuli

Asked by surfdork

I need to use a MSFT registry query in my automation.
My regustry query returns the DPI value of the screen. From this valu I will have my scrpt take one of 3 pathways

Sinnce it's a VBS script I can launch it from the desktop also thhe value is returned on thhe desktop in a message box. This is not optional hoever I have a demo tomorrow morning and don't have the time to fight with another MSFT issue.

So after launching the script is there a way I can grab the value returned as a string and import it into Sikuli?

I prefer to compare strings instead of images in this case.

Thank you!

Mike

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
surfdork
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

if it is possible to select the text in the message box using the mouse (button down, drag, button release) and use ctrl-c to copy this selected text to the clipboard, then you can use Env.getClipBoard() in Sikuli to get the text as a string.

an example: http://sikuli.org/blog/2010/05/06/extract-text-with-clipboard/

otherwise no chance in the short time (alternative is OCR: https://answers.launchpad.net/sikuli/+question/123945, just if you have some spare time and be interested).

Revision history for this message
surfdork (surfdork) said :
#2

Thank you! I will use this solution in the future. Last night I used an exists() and verified if Sikuli could see the target object instead of attempting to grab the DPI setting string I queried for using WMI.