Jump to content

DelStone

Active Members
  • Posts

    68
  • Joined

  • Last visited

DelStone's Achievements

Wayfarer

Wayfarer (2/7)

1

Reputation

  1. I often have a need to do this so wrote this general function that allows using a variety of alternative elements you can grab - it is quite straightforward but let me know if you need any explanation - no doubt it can be tidied up - but it does the job for me: ; Return $element on specified form of type "class/name/id/value..." etc with a given text label eg "submit" or "OK", which occurrance number (if the text value can appear more than once in the html code) and a html tag like "input/div/a..." etc Func GetFormElement($form_name, $type, $label, $count = 1, $tag = "", $oIE) Local $form, $element, $elements, $i = 1 If $form_name <> "" Then $form = _IEFormGetObjByName($oIE, $form_name) If $form_name = "" Or @error Then If $tag = "" Then $elements = _IETagNameAllGetCollection($oIE) Else $elements = _IETagNameGetCollection($oIE, $tag) EndIf Else $elements = _IEFormElementGetCollection($form) EndIf For $element In $elements Switch $type Case "class" If _IEPropertyGet($element, "class") And StringInStr($element.class, $label) Then If $i = $count Then Return $element $i += 1 EndIf Case "id" If _IEPropertyGet($element, "id") And StringInStr($element.id, $label) Then If $i = $count Then Return $element $i += 1 EndIf Case "name" If _IEPropertyGet($element, "name") And $element.name = $label Then If $i = $count Then Return $element $i += 1 EndIf Case "value", "title" If StringInStr($element.outerhtml, $label, 1) And StringInStr($element.outerhtml, $type) Then If $i = $count Then If Not $LIVE Then ConsoleWrite("GETFORMELEMENT : 1 " & $element.outerhtml & @CRLF) Return $element EndIf $i += 1 EndIf Case "misc" If StringInStr($element.outerhtml, $label) Then If $i = $count Then Return $element $i += 1 EndIf EndSwitch Next Return 0 EndFunc ;==>GetFormElement
  2. problem is that whether I use the WM_MESSAGE or not, I can't get the popup to appear...
  3. I use the following code in the WM_NOTIFY routine to call function PopupMenu The function doesn't display a popup menu even though the msgboxes appear fine - indicating it's calling the code - anyone know what I'm missing?
  4. Try winwait instead of winwaitactive - which app are you trying to automate
  5. The link I gave you is trying to click a tab that has not been created in their own app but in outlook: "I'm making a program to automate account creation in outlook 2k3. I get all the fields entered with text, click the "More Settings" button, but I cannot click an individual tab. I want to click the "Outgoing mail server" tab and check "My server requires authentication" is there a way to do this without using send keys, and click by coordinates?"
  6. Probably because the app (msi) has to end before it moves on... are you waiting till it terminates before you are checking for a window or is the window you are checking for from the msi app?
  7. Have you tried ShellExecute? After running the requested program the script continues with this command. To pause execution of the script until the spawned program has finished the ShellExecuteWait function is usually used - which appears to be what you are doing...
  8. You may want to look at which addresses a similar request...
  9. I don't believe it - it's just started to work! I've not done anything to the code which I tried before which wasn't working - freaky! But thanks guys - much appreciated...
  10. Hi Andreik Thanks for your update - I've looked at @error and it contains 0 - I've run the above code on two machines, XP and Windows 7 and same result on both... I'm not sure why you get it to work and it does not download anything for me...
  11. qsek - there is no error reported - it runs fine, returns 0 as the filesize and does not download anything andreik - your code too does not download any file. If I enter the url into a broswer it downloads the install file - if I use inetget it does not download anything...
  12. Hi all I've tried to download the mysql installation file using $file_to_get = "http://dev.mysql.com/get/Downloads/MySQLInstaller/mysql-installer-5.5.21.0.msi/from/http://mirrors.dedipower.com/www.mysql.com/" InetGet($file_to_get, $file_to_save,1 ,0) However it refuses to dowload - any thoughts why?
  13. It's strange that when I call an external program to complete an input box selected in IE via IEACTION($oIE, "clieck") it works fine but when I do the same via an adlibregister function it does not...
  14. I have BrewmanNH - it does not seem to work - the program just exits at the point. If I comment out the ensure_visible line, it continues and @error is 0 after the clickitem call... however it does not select the item in the listview which is simply minimized - if it is not minimized, it is selected ok. Is that how the function clickitem is meant to work - it doesn't seem right... $CHndl = ControlGetHandle("Identity Cloaker", "", "SysListView321") _GUICtrlListView_EnsureVisible($CHndl, $row - 1) _GUICtrlListView_ClickItem($CHndl, $row - 1, "left", False, 2)
×
×
  • Create New...