Delay in execution time for each line

Asked by Luis Rojas

Hi all,

currently i'm writing some code that looks like this:

    type(sampleDataPath+"/data.mnc"+Key.ENTER)
    wait(2)
    type(Key.ENTER)

My issue is that sikuli is executing the lines of code too fast and i dont want the code to be filled with waits ( either time based or image based )

is there any way to specify the "speed" at wich sikuli executes the lines of code? as it stands now, the sample code i put has to have the wait in the middle, the first command selects the file in a dialog box, then after a couple of seconds i can pres enter to actually open the file, but without the delay the enter key is setn before there is anything to handle it. so it does not get executed...

Thanks in advance

Question information

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

There is currently no other way, than to mix wait()'s in the workflow.

--- version 1
type(some_text); wait(1)
type(more_text); wait(3)
type(Key.ENTER); wait(1)

so you at least have the wait() on the same line.

--- version 2 (basic solution
def mytype(text, t = 0):
    type(text)
    wait(t)

usage:
mytype(some_text, 1)
mytype(more_text, 3)
mytype(Key.ENTER, 1)

so you can use my type() for this special case and type(); wait() for all other cases (need modifier keys or integrated find).

Can you help with this problem?

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

To post a message you must log in.