Run same script to a greater extent

Asked by sami baig

I would like to run following script more than 10 times on single instruction

myScript:

click("1514867348422.png")
if exists("1514867386964.png"):

while not exists("1514871869228.png"):
wait(10)
click("1514867400749.png")
type(Key.TAB, KeyModifier.SHIFT + KeyModifier.ALT)
else:
popup("Script done.")

       Should I paste this script manually more than one or is there any coding to run this script multiple times ?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
sami baig
Solved:
Last query:
Last reply:
Revision history for this message
masuo (masuo-ohara) said :
#1

define function and call that function in while loop.

def script1():
    click("1514867348422.png")
    if exists("1514867386964.png"):

        while not exists("1514871869228.png"):
            wait(10)
        click("1514867400749.png")
        type(Key.TAB, KeyModifier.SHIFT + KeyModifier.ALT)
    else:
        popup("Script done.")

for i in range(10):
    script1()

Revision history for this message
sami baig (gabbarmic) said :
#2

Thanks, You resolved my query.