Jump to content

ShaneF

Members
  • Posts

    9
  • Joined

  • Last visited

Everything posted by ShaneF

  1. As it stops the entire script from running I thought the best way to handle it would be to write and compile another script that constantly runs during this script to check for these dialogs and respond OK to all of them. Here is the code for the small app: $ctr = 0 while $ctr=0 $var = WinList() For $i = 1 to $var[0][0] If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then if $var[$i][0] = "Message from webpage" Then WinActivate("Message from webpage") ControlClick("Message from webpage","","Button1") EndIf EndIf Next sleep(250) WEnd Func IsVisible($handle) If BitAnd( WinGetState($handle), 2 ) Then Return 1 Else Return 0 EndIf EndFunc
  2. Nice idea, but the script pauses when the action image is clicked (the click triggers the popup). The problem is that there is no button control to handle so I've been unable to use ControlSend functions and I can't get an IE control ID to handle it. The problem with MouseClick is that there are several possible responses, so the OK button will appear in different places...
  3. Would this kind of thing work to handle JS alerts? I'm having a real problem handling them in AutoIT, nothing I do seems to work in both identifying them and responding to them.
  4. Just to clarify - it is javascript 'alerts' I'm having issues with... I have tried every single way I can find and have even tried being creative without luck. It has to be possible - it works in a competing product, but my HQ want me to stick to AutoIT as we have some internal support for it. This, however, stumped them...
  5. Hey guys, After hours of research on here and the help file I am unable to get the above to work. I have an image I have to click on the webform which then instantly initiates a JS popup with either an error or confirmation message in it. The title is "Message from webpage" (sounds customised) but AutoIT can not find it. Here is the code I'm having trouble with... $oForms = _IEFormGetObjByName($oIE,"containerForm") $oSite = _IEFormElementGetObjByName($oForms, "xml:/Shipment/@ReceivingNode") $oCtnr = _IEFormElementGetObjByName($oForms, "xml:/Shipment/Extn/@UnitNo") $oBill = _IEFormElementGetObjByName($oForms, "xml:/Shipment/Extn/@BillOfLading") _IEFormElementSetValue($oSite,$site) _IEFormElementSetValue($oCtnr,$ctnr) _IEFormElementSetValue($oBill,$bill) _IEImgClick($oForms,"action.gif") if WinExists("Message from webpage") then WinActivate("Message from webpage", "") ControlClick("Message from webpage", "", "[CLASS:Button; TEXT:OK; Instance:1;]") EndIf Looking at the XML/AJAX source for the site reveals there is no control name for the image that is clicked, so I couldn't effectively implement the Example 2 in _IEAction that everyone seems to get pointed to. I've tried everything from newbie-style sleeping and sending Enter to the _IEAction thing ending up with the above - any more ideas?
  6. Thanks, I'll have a look at your suggestion, but seeing as I was printing the file to text for another application I just thought it best to make another use for it >_< Thanks for your help though, much appreciated
  7. I've come up with a work-around, and thought I would post it back on here for anyone else who may run into similar trouble. I used the {PRINTSCREEN} keystroke to print the output to a text file, and as the value is always in the same location just devised a procedure to select the value within that file, and copy it to clipboard, and return the value to a variable. The script then inserts extra {TAB} keystrokes when needed, dependant on that returned value.
  8. Hey - thanks for the welcome... Unfortunately I can't divulge the exact site of the 3rd party, but it's something known all too well in the frieght industry. It uses something called Evergreen Terminal Server mounted in an IE window, and they have taken control of the Ctrl+C function to direct you to another menu (rather than copy function). Thanks for the attempt though, I have spent days searching the internet for an answer and it's starting to annoy me >_<
  9. Hi, I've searched the internet high and low to find an answer for this and as yet come back with nothing. I wrote an autoit script that uses keystrokes and tabs to navigate a HyperTerminal-style session within an IE window. It's a third-party's system that we have no choice but to use, and I'm trying to save the effort of someone sat there day-in, day-out just keying information into a window and copy/pasting the returned reference numbers. It fills in the fields and then sends and ENTER keystroke. Now, dependant on the value returned it can then place the cursor in either of two fields, one is blank (and I wish it to remain so), and one that has the default value of 'Y' - which I need to change to 'N'. Is there any way I can get the script to read what text is at the current cursor (not mouse position) location and send an extra TAB if it doesn't read 'Y'? Any ideas would be greatly appreciated >_< BTW, I am very new to AutiIt (been using for one week) and wish I'd known about it a lot sooner!
×
×
  • Create New...