← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #662682]: Facing some hiccups when running skl script from excel VBA

 

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

    Status: Open => Answered

masuo proposed the following answer:
Try this codes.

[SikuliX script:]
def script01(event):
    popup("script01")

def script02(event):
    popup("script02")

Env.addHotkey("m", KeyModifier.CTRL, script01)
Env.addHotkey("n", KeyModifier.CTRL, script02)
popup("Click [OK] to exit")

[EXCEL VBA:]
Private Declare Sub Sleep Lib "Kernel32" (ByVal ms As Long)
Sub Button1_Click()
    SendKeys "^m"
    Sleep 5000
    
    SendKeys "^n"
    Sleep 5000
End Sub

[Operation:]
#1 Run SikuliX script, popup "Click [OK] to exit" appear
#2 Click Button1 on EXCEL
#3 popup "script01" appear
#4 click [OK] of popup #3
#5 popup "script02" appear
#6 click [OK] of popup #5
#7 click [OK] of popup #1

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.