Jump to content

More Questions!


makogen
 Share

Recommended Posts

Ok, so I've got a few questions so here we go;

1)I have a script that takes information from a table in IE, and takes parts of it and throws it into an excel document. Heres the code I have for that:

$oTable = _IETableGetCollection($oIE, $xcount)
        
        $XLArray = _IETableWriteToArray($oTable)
        _XLArrayWrite ($XLArray, $sFilePath, 1, 1, 1, 1)

I don't want to have to write it to the excel document just to get the information sorted. Is there a way to go through the array and get the information? Maybe since it's a 2D array I just call the array and pick the coordinates? I don't know, I'll keep trying to figure it out, but a little help would be nice :).

2) I was going through the help files and I came across the _IELinkGetCollection function. The sample script was very interesting and introduced me to objects.

#include <IE.au3>
$oIE = _IE_Example ("basic")
$oLinks = _IELinkGetCollection ($oIE)
$iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")
For $oLink In $oLinks
    MsgBox(0, "Link Info", $oLink.href)
Next

I know the $oLink.href pulls the web address the current link is pointing to, but I also found the _IEFormGetCollection function had a similar thing going on with it

#include <IE.au3>
$oIE = _IECreate ("http://www.google.com")
$oForms = _IEFormGetCollection ($oIE, 0)
For $oForm In $oForms
    MsgBox(0, "Form Info", $oForm.name)
Next
_IEFormSubmit ($oForm)

with its $oForm.name. How do these work? I think they look at the html tags and return the values. Is that true? and if it is. can an object $oTable be treated the same way? can I take the contents from an object like $oTable? And What other object commands are there?

3) I have a gui on another script that has a set of 2 radio select elements. When the first one is checked, I want the regular gui to be shown and a file path input field grayed out, however when the other is checked, I want the regular gui grayed out, while a file path input field is shown. How can I do this without the crazy flashiness?

4)I have multiple guis in one script, and depending on a drop down select element in the corner, a different one is shown. Here is the code:

Select
                    Case GUICtrlRead($cmbMode) == "ToolBox"
                        GUISetState(@SW_HIDE, $spider)
                        openToolBox()
                    Case GUICtrlRead($cmbMode) == "AntiHax"
                        GUISetState(@SW_HIDE, $spider)
                        openAntiHax()
                    Case GUICtrlRead($cmbMode) == "Crawler"
                        GUISetState(@SW_HIDE, $spider)
                        openCrawler()
                EndSelect

Is there a way to just have one gui that only changes its elements instead of making a new gui? or is this already the best way?

I know every time I post, I ask about a lot of things, thanks for all the patience and wisdom you've shown :) Any help you can give is much appreciated. Thanks!

Link to comment
Share on other sites

Ok, so I've got a few questions so here we go;

1)I have a script that takes information from a table in IE, and takes parts of it and throws it into an excel document. Heres the code I have for that:

$oTable = _IETableGetCollection($oIE, $xcount)
        
        $XLArray = _IETableWriteToArray($oTable)
        _XLArrayWrite ($XLArray, $sFilePath, 1, 1, 1, 1)

I don't want to have to write it to the excel document just to get the information sorted. Is there a way to go through the array and get the information? Maybe since it's a 2D array I just call the array and pick the coordinates? I don't know, I'll keep trying to figure it out, but a little help would be nice :).

Your $XLArray is just a 2D array, and can be searched or sorted as any other 2D array. Ask a more specific question if that's still a problem for you.

2) I was going through the help files and I came across the _IELinkGetCollection function. The sample script was very interesting and introduced me to objects.

I know the $oLink.href pulls the web address the current link is pointing to, but I also found the _IEFormGetCollection function had a similar thing going on with it

with its $oForm.name. How do these work? I think they look at the html tags and return the values. Is that true? and if it is. can an object $oTable be treated the same way? can I take the contents from an object like $oTable? And What other object commands are there?

They are not "looking" at any text at all. The "objects" are special creatures of the application programming interface (API) and have pre-defined "properties" associated with them (in this case, IE APIs). A "Link object" has a ".href" property you can read, and "Form object" has a ".name" property. You can see more at places like this: MSDN: Link element/Link object

Also read the AutoIt help file under "Obj/COM Reference".

3) I have a gui on another script that has a set of 2 radio select elements. When the first one is checked, I want the regular gui to be shown and a file path input field grayed out, however when the other is checked, I want the regular gui grayed out, while a file path input field is shown. How can I do this without the crazy flashiness?

Only update the GUI when something changes. You are probably updating something in a loop whether it changed or not.

4)I have multiple guis in one script, and depending on a drop down select element in the corner, a different one is shown. Here is the code:

Is there a way to just have one gui that only changes its elements instead of making a new gui? or is this already the best way?

Yes, you can change almost anything on the existing GUI, but your example doesn't create any new GUIs, so far as you showed.

I know every time I post, I ask about a lot of things, thanks for all the patience and wisdom you've shown :P Any help you can give is much appreciated. Thanks!

It would be better if you posted a separate topic for each unique question. The forum doesn't impose any penalty for starting multiple topics. There is no economy to multi-topic posts like this. They only make it more likely you'll get partial answers.

:)

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...