← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #264483]: 1.0.1 how to run sikuli script from command line

 

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

RaiMan proposed the following answer:
BTW, this is exactly where you could make your whole stuff some more
transparent.

# openAppleMenu.sikuli
App.focus("Chrome")
Settings.DelayAfterDrag = 0
Settings.DelayBeforeDrop = 0
Settings.MoveMouseDelay = 0
hover(Pattern("1427842411231.png").similar(0.94))
mouseDown(Button.LEFT)
count = 0
try:
    matches = list(findAll(Pattern("1425879837185.png").exact()))
    count = len(matches)
except FindFailed:
    pass #nothing to do
print "found:", count

if count > 0:
    sortedMatches = sorted(matches, key=lambda m:m.y) # sorts top to bottom
    hover(sortedMatches[-1]) # take the last one
mouseUp(Button.LEFT)

# main.sikuli
def openAppleMenu(event):
    runScript("openAppleMenu")

Env.addHotkey(Key.F2, KeyModifier.ALT+KeyModifier.CTRL, openAppleMenu)

while True;
    wait(1)

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