Script: can you prefill input() --- yes: input("message text", "prefill")

Asked by dude

is there way i can have a input field prefill with a string or variable

currently i have to manually type in a number for later use i dont like that
it is displayed in the top left of a ticketing system we use though and using the built in OCR I can read the number, but its not 100% accurate.

so what i want to happen is have the existing input popup show up with ticket number pretyped in from the OCR so if I need to change any of the numbers i can and if it correct all i need to do is hit ok

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

  • by dude
Revision history for this message
RaiMan (raimund-hocke) said :
#1

input("message text", "prefill")

Revision history for this message
dude (dude1) said :
#2

Thanks RaiMan, that solved my question.

Revision history for this message
dude (dude1) said :
#3

so i tried input("message text", "prefill") on my mac and it worked just fine
however when i did it on my windows machine it didnt work
I realized it is because my windows machine is running RC3 and not 1.0.1
But when I tried to install sikuli I get this error message
http://postimg.org/image/xm4l8zypj/

It's Windows XP SP3 and currently running Java 6 release 43 but i also tried the latest java 7 with the same result
if there is not fix is there any chance you can tell me how i could make a input box similar to the one used in the newer versions of sikuli

thanks

Revision history for this message
RaiMan (raimund-hocke) said :
#4

-- 1. RC3
in the latest version r930 the input() function with prefill exists.
If you still have the r905, you might try with the update to r930:
start here: http://www.sikuli.org/downloadrc3.html

-- 2. 1.0.1 setup problem
- you should use as setup folder something like c:\SikuliX (avoid paths containing blanks)
- take care: purge the path entry to the RC3 libs folder from system path settings
- if the setup crashes give it one more try after emptying the folder
- if it does not work, try the offline setup (see faq 2363)

-- 3. selfmade input() with prefill
import javax.swing.JOptionPane as JO
answer = JO.showInputDialog("text", "preset")
print answer

Can you help with this problem?

Provide an answer of your own, or ask dude for more information if necessary.

To post a message you must log in.