← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #189054]: how to generate sequential numbers as my script saves screen grabs

 

Question #189054 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/189054

    Status: Open => Answered

RaiMan proposed the following answer:
trying hard ;-) to identify the code block, that should be repeated, I
suggest the following:


click("READING-5.png")
for pnum in range(1,400): # see comment
    click("1330391579704-3.png")
    click("new-2.png")
    wait(1)
    dragDrop("READING-5.png", "1330385440306-2.png")
    click("IIDDIS-2.png")
    wait(1)
    doubleClick("Filename-2.png")
    type("%03d"%pnum)
    click("Cancel-2.png")
    wait(1)
    doubleClick("1330388006782-2.png")

--- comment: when testing, you should put 3 or 4 instead of 400

After copying it to the IDE (you need to copy it into your current
script and delete the old stuff, so the pictures are found), take care,
that the indentation (blanks at the beginning of the line following the
line "for ....")

If you get any indentation errors, look faq 1800

BTW: Seems to be on a Mac. Might be, that there are easier ways to
accomplish your target. If you want to know, talk about it in detail,
what you are clicking and dragging there.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.