autoit - How to run custom function in a specific window and work in background? -
i wrote script using autoit. problem run in background can use desktop other work.
i used _imagesearch()
works on active window. there way call such function in background? here code:
winactivate('window title') $x = 0 $y = 0 if _imagesearch('searchbutton.png', 1, $x, $y, 20) = 1 return 1 elseif _imagesearch('bundle.png', 1, $x, $y, 20) = 1 send('{esc}{lctrl}{lctrl}{lctrl}') sleep(1000) else send('{lctrl}') endif
write script runs continuously , call image search hotkey:
hotkeyset('+!e', '_endscript') ; terminate script shift+alt+e hotkeyset('+!i', '_searchimage') ; calls image search function shift+alt+i ; main loop while true sleep(50) wend func _endscript() exit endfunc func _searchimage() ; image search stuff endfunc
but may other application blocks hotkeys. try it.
Comments
Post a Comment