help_me_please Posted April 9, 2018 Posted April 9, 2018 Hello forum world, I am having an issue with a popup window displaying after selecting something using the ControlCommand( ) function. I am able to select the desired item from the dropdown list using the control command function but a popup window opens immediately after, not allowing the control command function to finish. Such as: ConsoleWrite("Before ControlCommand" & @CRLF) ControlCommand($Win_Name, "", $ID, "SelectString", $DropItemName) ConsoleWrite("After ControlCommand" & @CRLF) ^^^^ So in the console I can get the "Before...", then the ControlCommand executes the selection of the dropdown menu. Popup window opens But since there is a popup, I can not get the "After..." statement to write to the console. This is where I am stuck, as I can not execute another command to close the popup window. Send help, oh gracious autoit forum.
JohnOne Posted April 9, 2018 Posted April 9, 2018 (edited) Write a script to wait for and close the popup, and end. (separate script) Run the script just before your ControlCommand. Edited April 9, 2018 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
help_me_please Posted April 9, 2018 Author Posted April 9, 2018 (edited) 17 minutes ago, JohnOne said: Write a script to wait for and close the popup, and end. (separate script) Run the script just before your ControlCommand. @JohnOne How would I run that script and the controlcommand at the same time? The other script would go something like this? Popup_Check( ) While 1 IF WinState($PopupWinName) <> 0 Then WinExit($PopWinName) Endif WEnd ControlCommand( Select from drop down) Edited April 9, 2018 by help_me_please
JohnOne Posted April 9, 2018 Posted April 9, 2018 Separate popup.au3 ShellExecute("popup.au3") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
help_me_please Posted April 9, 2018 Author Posted April 9, 2018 17 minutes ago, JohnOne said: Separate popup.au3 ShellExecute("popup.au3") @JohnOne I tried the suggestion and it does appear to be working. Startup_Popup_Window_Killer.au3 ;Popup Window Closing Function Local $timer_start = TimerInit() Local $timer_delta = TimerDiff($timer_start) While $timer_delta < 3000 ;Close popup window if it exists If WinGetState($PopupWinName) <> 0 Then WinClose($PopupWinName) EndIf $timer_delta = TimerDiff($timer_start) ConsoleWrite(round($timer_delta/1000,4) & @CRLF) WEnd Script to Run both: ShellExecute("Startup_Popup_Window_Killer.au3") ControlCommand( ) Please advise.
JohnOne Posted April 9, 2018 Posted April 9, 2018 Does it actually work to close the window when run outside of your script? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
help_me_please Posted April 9, 2018 Author Posted April 9, 2018 2 minutes ago, JohnOne said: Does it actually work to close the window when run outside of your script? @JohnOne It does.
JohnOne Posted April 9, 2018 Posted April 9, 2018 Must be because It's a child process of AutoIt then. Not sure where to go, perhaps having the popup closer starting your main script instead, then waiting for the window might be worth a go. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
help_me_please Posted August 6, 2019 Author Posted August 6, 2019 I ended up creating a second *.exe program that loops in the background to look for the popup window names. Works well and severs as a GUI to display stats on the first program. Thanks for the support!
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