← 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

    Status: Answered => Open

eduardobedoya is still having a problem:
Hi RainMan, ok I read your last link, abd tried this...

def openAppleMenu(event):
    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)
    
Env.addHotkey(Key.F2, KeyModifier.ALT+KeyModifier.CTRL, openAppleMenu)


I run this script and it shows in the Message box...
"[info] HotkeyManager: add Hotkey: CTRL+ALT F2 (113, 10)"


but it just doesn't work, whenever I prese the Alt Ctrl F2 keys nothing happen
What I am doing wrong???

THanks Advanced.

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