Knotty Alder Posted July 20, 2006 Share Posted July 20, 2006 Here's my dilema and I'm hoping some of the veterans here can give me a hand. Currently my work is updating there computer system. They're transferring all the data from their current system into a new system. In order for everything to transfer over all client data needs to be "finalized". What this means is that I have to go through thousands of client pages and if the document has not been finalized I click the finalize button. There is nothing difficult in this task it just takes forever. My only problem is that the amount of documents the client has changes, because that amount changes the links I have to click on are in a different positions for each client. Each link is named the same thing "EMR", is there anyway I can have AutoIt go through and find and activate the EMR links. After the EMR link is activated a new page is brought up. This is where I check to see if the document has been finalized. If it has been finalized I close the new page and move on, if it hasn't I click finalize and then I close the page and move on. Is there anyway to have AutoIt detect if the button says "finalize" or "reopen" (if the button says "reopen" then it has already been finalized). I know this is all very confusing. If anyone thinks that they'll be able to help me I can give them screen shots so they can tell exactly what I'm trying to do. Thanks for all your help. Link to comment Share on other sites More sharing options...
Valuater Posted July 20, 2006 Share Posted July 20, 2006 1 Get the "Control Information" on your computer click... Start > All Programs > Autoit v3 > Autoit Window Info 2 Control Command to click for you see "ControlCommand" and ControlClick" in the help file 8) Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 (edited) There's no ControlID on the link I'm trying to activate. Here's a screenshot, maybe this can help clear things up. Thanks again for all your help. PS - My mouse was overtop of the orange EMR link when I took the screenshot. Edited July 20, 2006 by Knotty Alder Link to comment Share on other sites More sharing options...
Valuater Posted July 20, 2006 Share Posted July 20, 2006 for "controlling" Internet Explorer...you will need to use the IE.au3 Libraryhere.... http://www.autoitscript.com/forum/index.php?showtopic=25629HOWEVER... you will need the beta version of Autoithere..... http://www.autoitscript.com/forum/index.php?showtopic=19717AND... the current ( new ) beta has IE.au3 Built into itsee the help file for great examples at the bottom of the pages. Maybe search for "IE" in the search help tab8) Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 20, 2006 Moderators Share Posted July 20, 2006 There's no ControlID on the link I'm trying to activate. Here's a screenshot, maybe this can help clear things up. Thanks again for all your help. PS - My mouse was overtop of the orange EMR link when I took the screenshot.Your best bet will be to use IE.au3 which is included in the latest beta. If you could throw the page source into a .txt file and post it here, we should be able to help you. Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 Thanks, I'm working on the .IE code right now, but it comes up with an error when I try and run the script. Error reading the file: IE.au3 Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 (edited) Here's my very very basic script. I'm just trying to figure out how to get this IE script to work. However, I'm still coming up with an error when I try and load it. #include <IE.au3> $oIE = MD InSite - Atlanta Dermatology & Vein - Microsoft Internet Explorer _IELinkClickByText ($oIE, "EMR" [, $i_index = 1]) I wasn't sure what the $oIE was supposed to be, so I put in the website title. Edited July 20, 2006 by Knotty Alder Link to comment Share on other sites More sharing options...
Valuater Posted July 20, 2006 Share Posted July 20, 2006 (edited) you didn't look at the examples on the bottom of the help file pages heres one ; ******************************************************* ; Example 1 - Create browser windows with each of the example pages displayed. ; The object variable returned can be used just as the object ; variables returned by _IECreate or _IEAttach ; ******************************************************* ; #include <IE.au3> $oIE_basic = _IE_Example ("basic") $oIE_form = _IE_Example ("form") $oIE_table = _IE_Example ("table") $oIE_frameset = _IE_Example ("frameset") $oIE_iframe = _IE_Example ("iframe") and... you will "normally" start with IECreate() #include <IE.au3> $oIE = _IECreate ("http://sourceforge.net", 0, 0) ; Display the innerText on an element on the page with a name of "sfmarquee" $oMarquee = _IEGetObjByName ($oIE, "sfmarquee") MsgBox(0, "SourceForge Information", $oMarquee.innerText) _IEQuit ($oIE) 8) 8) Edited July 20, 2006 by Valuater Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 Okay, here's exactly what I need to do. I've attached a screenshot of the page I'm going to be working from. On this page I've circled one of the EMR link that I'll be needing to access. I need to click the EMR link which will bring up a new window (screenshot number two/three). I've circled the link that I will be dealing with on this new popup. The link will either say Reopen or it will say Finalize. If it says Reopen I need to close the page and move onto the next EMR link. If it says Finalize I need to click the button and then close the page and move onto the next EMR link. Does any of this make sense. Also, thanks for all your help. You're right, I'm new to this program and haven't had a ton of coding expirence, but everyone has to start somewhere right. Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 The page doesn't close by itself, but Ctrl-W on the keyboard will close it. The only thing I've been able to code so far doesn't give me any results: #include <IE.au3> _IEAttach ("MD InSite - Atlanta Dermatology & Vein") $oIE = "MD InSite - Atlanta Dermatology & Vein" $iIE = 1 _IELinkClickByText ($oIE, "EMR", $iIE ) Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 20, 2006 Moderators Share Posted July 20, 2006 I will try to code some if others don't respond... but others have more IE experience. It seems there needs be...- IEAttach\/- a loop that enumerates links looking for "EMR"...- click link and wait for applet page- IEAttach to next page and enumerate looking for Finalize or ReOpen...- - if reopen... close page- - if Finalize - click button (does page close by itself?)- back to top of loop/\This is exactly right, give me a few minutes and I'll have you something to start with. Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 I run the code but nothing happens, no errror no link clicked. Am I doing something wrong? The words EMR is written at the top of the page, but it's not a link. Does this affect it? Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 I'm still not getting anything. Is it something on my end that I'm doing wrong? Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 Your message box comes up saying Attached Okay, after that nothing. PS - how did you learn how to code all this? Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 20, 2006 Moderators Share Posted July 20, 2006 I run the code but nothing happens, no errror no link clicked. Am I doing something wrong? The words EMR is written at the top of the page, but it's not a link. Does this affect it?Try this, but note the comments I made in the code: expandcollapse popup#include <IE.au3> Opt("WinTitleMatchMode", 2) _IEErrorHandlerRegister() $sURL = "http://mdinsite.dermandvein.com/tasc/servlet/Main" $oIE = _IEAttach($sURL, "url") If Not IsObj($oIE) Then $oIE = _IECreate($sURL) EndIf $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks $sLinkText = $oLink.outerText $sLinkURL = $oLink.href If $sLinkText = "EMR" Then $oLink.click EndIf WinWait($sLinkURL) $oIE2 = _IEAttach($sLinkURL) If IsObj($oIE2) Then _IELoadWait($oIE2) $oForm = _IEFormGetCollection($oIE2, 0) ; This is a guess because I don't have the page source. If IsObj($oForm) Then $oButton = _IEFormElementGetCollection($oForm, 6) ; This is also a guess If IsObj($oButton) Then $sVaule = $oButton.value Switch $sVaule Case "Reopen" _IEQuit($oIE2) ContinueLoop Case "Finalize" $oButton.click _IELoadWait($oIE2) _IEQuit($oIE2) EndSwitch EndIf EndIf EndIf Next Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 20, 2006 Moderators Share Posted July 20, 2006 I think we have a "Frame" problem... The links are in a frame... ugh... lemme thinkLar.This would be so much easier if we could see some page source. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 20, 2006 Moderators Share Posted July 20, 2006 (edited) I added msgboxes to every possible point of failure I could think of. expandcollapse popup#include <IE.au3> Opt("TrayIconDebug", True) Opt("WinTitleMatchMode", 2) _IEErrorHandlerRegister() $sURL = "http://mdinsite.dermandvein.com/tasc/servlet/Main" $oIE = _IEAttach($sURL, "url") If Not IsObj($oIE) Then $oIE = _IECreate($sURL) EndIf $oFrame = _IEFrameGetObjByName($oIE, "detail") If Not IsObj($oFrame) Then MsgBox(0, "", "Unable to get reference to frame.") Exit EndIf $oLinks = _IELinkGetCollection($oFrame) If Not IsObj($oLinks) Then MsgBox(0, "", "Unable to obtain link collection.") Exit EndIf For $oLink In $oLinks $sLinkText = $oLink.outerText $sLinkURL = $oLink.href If $sLinkText = "EMR" Then $oLink.click EndIf WinWait($sLinkURL) $oIE2 = _IEAttach($sLinkURL) If IsObj($oIE2) Then _IELoadWait($oIE2) $oForm = _IEFormGetCollection($oIE2, 0) ; This is a guess because I don't have the page source. If IsObj($oForm) Then $oButton = _IEFormElementGetCollection($oForm, 6) ; This is also a guess If IsObj($oButton) Then $sVaule = $oButton.value Switch $sVaule Case "Reopen" _IEQuit($oIE2) ContinueLoop Case "Finalize" $oButton.click _IELoadWait($oIE2) _IEQuit($oIE2) EndSwitch Else MsgBox(0, "", "Unable to get reference to button.") Exit EndIf Else MsgBox(0, "", "Unable to get reference to form.") Exit EndIf Else MsgBox(0, "", "Unable to attach to new browser window.") Exit EndIf Next Edit: Updated code Edited July 20, 2006 by big_daddy Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 Here's the source code for one of the client pages, I don't know how helpful it's going to be.Main_1_.txt Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 On Larry's attempt I got the "Attached" message box and the "Got Frames" message box. Thanks again for all your help guys. Link to comment Share on other sites More sharing options...
Knotty Alder Posted July 20, 2006 Author Share Posted July 20, 2006 On Big Daddy's I got an error on line 21. Variable used without being declared. 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