SeF Posted November 11, 2009 Share Posted November 11, 2009 Hi there! This is my first post here, and I hope that It will be the first of many. I really loved AutoIt! Here is thing: I created a script that automates filling some forms using WinWaitActive. But, there is sometimes that occurs some PC's lag (caused by memory or LAN issue) when switching between tabs/screens and my script don't work properly. And in these tabs, the program's title don't change and there aren't any "Visible Text" that I can use along with WinWaitActive. Is there any function that "knows" when a InputBox is ready? (I think that will solve my problem) Thanks! Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 12, 2009 Share Posted November 12, 2009 (edited) Hi there! This is my first post here, and I hope that It will be the first of many. I really loved AutoIt! Here is thing: I created a script that automates filling some forms using WinWaitActive. But, there is sometimes that occurs some PC's lag (caused by memory or LAN issue) when switching between tabs/screens and my script don't work properly. And in these tabs, the program's title don't change and there aren't any "Visible Text" that I can use along with WinWaitActive. Is there any function that "knows" when a InputBox is ready? (I think that will solve my problem) Thanks! Check the status of the control in a loop with something like ControlGetText() which will set @error if the control doesn't exist yet. Once it exists (@error = 0) use ControlSetText() or ControlSend() to input the text. P.S. Don't forget a short sleep like Sleep(10) to keep from hogging the CPU in your loop. Edit: Good point by Yashied, below. Lots of choices. Sometimes you have controls that are greyed out until ready, so could also be: If ControlCommand($hWnd, "", $CtrlID, "IsVisible") And ControlCommand($hWnd, "", $CtrlID, "IsEnabled") Then Even works if the control is being created on a new window and might not exist yet, because ControlCommand() returns 0 if the control isn't found. Edited November 12, 2009 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Yashied Posted November 12, 2009 Share Posted November 12, 2009 Or use ControlCommand($hWnd, "", $CtrlID, "IsVisible"). My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
SeF Posted November 14, 2009 Author Share Posted November 14, 2009 (edited) Thanks for the answers guys! I'm going to try something like this: Local $hWnd = WinGetHandle("[CLASS:SAP_FRONTEND_SESSION]") Func CheckScreen() If ControlCommand($hWnd, "", "Afx:10000000:10081", "isVisible") and ControlCommand($hWnd, "", "Afx:10000000:10081", "isEnabled") Then sleep(10) ;continues the script Else CheckScreen() EndIf EndFunc Then, I will insert the CheckScreen() between each time that I change screens/tabs. The problem is that the software (SAP) has only 1 class/instance. But, I hope that will work Edited November 14, 2009 by SilvioLobo 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