Pov Posted September 2 Share Posted September 2 (edited) I could use some help with the followins script: #include <GuiMenu.au3> #include <Misc.au3> #include <GUIConstantsEx.au3> #include <GuiToolbar.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> Global $CommandID = 0, $gui_CommandID, $Paused Opt("WinTitleMatchMode", 1) HotKeySet("^q", "Terminate") WinWaitActive("Siemens - E:\Projektai\cargo\PLC\2024-07-11\Cargo\Cargo","") For $i = 1 to 5 MouseClick("right",851,372,1,5) ; open menu Sleep(1000) MouseClick("left",896,382,1) ; click "open editor" Sleep(5000) MouseClick("left",947,219,1) ; click "Retain Sleep(500) MouseClick("left",1878,79,1,5) ; close screen Sleep(500) MouseClick("left",1884,1095,1,5) ; scrol Sleep(500) Next Func Terminate() Exit 0 EndFunc It compiles succesfully, however, when I try to run it nothing happens, no error codes are given, there is no indication that it is beeing executed. Also, I need to kill it manyally. Any sugjestions on what I'm doing wrong? Edited September 2 by Jos Link to comment Share on other sites More sharing options...
ioa747 Posted September 2 Share Posted September 2 (edited) try HotKeySet("^q", "Terminate") Local $hWnd = WinWaitActive("Siemens - E:\Projektai\cargo\PLC\2024-07-11\Cargo\Cargo", "", 5) If $hWnd Then ConsoleWrite("$hWnd=" & $hWnd & @CRLF) WinActivate($hWnd) For $i = 1 To 5 MouseClick("right", 851, 372, 1, 5) ; open menu Sleep(1000) MouseClick("left", 896, 382, 1) ; click "open editor" Sleep(5000) MouseClick("left", 947, 219, 1) ; click "Retain Sleep(500) MouseClick("left", 1878, 79, 1, 5) ; close screen Sleep(500) MouseClick("left", 1884, 1095, 1, 5) ; scrol Sleep(500) Next Else ConsoleWrite("! Window not found" & @CRLF) EndIf ConsoleWrite("End" & @CRLF) Func Terminate() Exit 0 EndFunc ;==>Terminate to forum how-to-post-code-on-the-forum Edit: first try without compiled and put some ConsoleWrite in the script so you can monitor the stream Edited September 2 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
Nine Posted September 2 Share Posted September 2 Seems to me that the WinWaitActive is waiting forever to find the window. Try a WinActivate before, and check if it is finding the right handle... Also you may want to replace your MouseClick with WinMenuSelectItem (see help file) ioa747 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now