Sign in to follow this  
Followers 0
Medic873

Change Images On WebPage

4 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

After reading through the help file I am still not aware if this is the correct way to use the or statement.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 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

Share this post


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
Sign in to follow this  
Followers 0