Medic873 Posted April 2, 2010 Share Posted April 2, 2010 Task I am trying to make it where when a page loads with a certin title it will automaticly reconize and change the permitted images on the page. So here is what I have so far If WinExists("Courseware - Microsoft Internet Explorer") Then WinActivate ("Courseware - Microsoft Internet Explorer") $oIE = _IEAttach ("Courseware - Microsoft Internet Explorer") $oIE = http://Courseware.com/Images/Learner/icon_inprogress.gif $sHTML = _IEBodyReadHTML ($oIE) if ($sHTML = "Courseware.com/Images/Learner/icon_inprogress.gif") Then $sHTML = $sHTML - "Courseware.com/Images/Learner/icon_inprogress.gif" & "http://learner.ple.platoweb.com/Images/Learner/icon_mastered.gif" _IEBodyWriteHTML ($oIE, $sHTML) endif but as you can see I dont quite think this is working can someone at least give me a push in the right direction thank you Link to comment Share on other sites More sharing options...
Medic873 Posted April 2, 2010 Author Share Posted April 2, 2010 I just discovered that the window can have multiple names as well so is there anything wrong with a statment like this $WindowTitles = "http://contentlaunch.ple - ® Courseware - Microsoft Internet Explorer" or "Courseware - Windows Internet Explorer" and then i did this If WinExists($WindowTitles) Then WinActivate ($WindowTitles) $oIE = _IEAttach ($WindowTitles) Is that okay or am i improperly using the or statement Link to comment Share on other sites More sharing options...
Medic873 Posted April 2, 2010 Author Share Posted April 2, 2010 After reading through the help file I am still not aware if this is the correct way to use the or statement. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 2, 2010 Share Posted April 2, 2010 (edited) No. Stop and get some idea how the _IE* functions work before continuing this project. Run the example scripts under those functions and see how they work. Some notes: 1. The default mode for _IEAttach() is document title, not window title (see help file). 2. The next line after _IEAttach() you attempt to destroy the object reference by overwriting it with a string. Don't do that. 3. The attempt to overwrite $oIE fails because you didn't put quotes around the string. 4. The $sHTML variable contains a lot more than just the URL of a single file. View it with a MsgBox() or ConsoleWrite() to see what the HTML really looks like. 5. Learn to use StringReplace() (see help file), and the proper string operators (see help file). If you won't learn the basics first, this project will remain over your head. However, those basics are not hard, so you can do this with a little effort. Edited April 2, 2010 by PsaltyDS 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 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