Jump to content

Incredibly confused by the Autoit Help file

Recommended Posts

I am a newbie to writing script, i've only dabbled with jQuery and html/css (which I find them easy enough for me to understand to get what I need done), but I am having an incredibly difficult time understanding the Autoit syntax/commands.

What I am trying to achieve sounds very simple but trying to write it in autoit script is pure frustration.

I basically need to select an option on a webpage with

url: www.example.com

<select name="Options" id="id_Options">
<option value="" selected="selected">---------</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>

I know the best way for me to do this is probably using the


But I am stumped at the example which also seem to require me to do use




Usually, i'd just look up the syntax for those functions, but the explanation for each of the parameters in the function is incredibly jargon-filled. Not that I don't understand the meaning of it, but I fail to draw a logical connection between the parameters and its use in that specific function....

So can somebody just give me a simple sample script using the html I provided above? And Select an option? This is how far I got...

#include <IE.au3>
$s_URL = "http://www.myriadsupply.com/admin/product/product/add/"
Local $o_IE = IECreate ($s_URL)
_IELoadWait ($o_IE)
Link to post
Share on other sites

You are on the right track. The Form on the desired page (which apparently requires a login so I cannot test) has an ID which is fed to _IEFormGetObjByName. Similarly the Option in question should have an ID which to provide to _IEFormElementGetObjByName.

If you run the example below you will see a demo page. if you examine the source code of the page you will find the corresponding object/element IDs ("ExampleForm" & "selectExample")

#include <IE.au3>
$oIE = _IE_Example ("form")
$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")
$oSelect = _IEFormElementGetObjByName ($oForm, "selectExample")
For $i = 1 To 10
    _IEFormElementOptionSelect ($oSelect, "Freepage", 1, "byText")
    _IEFormElementOptionSelect ($oSelect, "midipage.html", 1, "byValue")
    _IEFormElementOptionSelect ($oSelect, 0, 1, "byIndex")
Edited by spudw2k
Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...