Jump to content

StatusBarGetText Error


Recommended Posts

Warning: Im new to AutoIt, but i have a general knowledge on scripting, but im no expert.

What i want: Cursor to hover over 6 Text Links on a Windows Internet Explorer screen and based on the Status Bar Message either Click or skip to next Text Link.

Its kind of a 'find the ball under the cup' problem, on screen are 6 Options, but only 1 is correct and this 1 wont always be in the same place as the previous time, so my script has to find the 'right' option out of 5 'wrong' options and then click the 'right' option.

I spent a good 5 hours looking over examples, as well as editing others codes to get the one i need, and i think i have found the way to do it, however, there is a conflict in the Scripting Code and the Status Bar Message that doesnt allow the Script to continue.

Here is my Script at the moment.

MouseMove(xxx,xxx)
If StatusbarGetText("website - windows internet explorer" [, "java script:top.mform("v",4,0,0)" ]) Then
MouseDown("left")
MouseUp("left")
EndIf

MouseMove(xxx,xxx)
If StatusbarGetText("website - windows internet explorer" [, "java script:top.mform("v",4,0,0)" ]) Then
MouseDown("left")
MouseUp("left")
EndIf

MouseMove(xxx,xxx)
If StatusbarGetText("website - windows internet explorer" [, "java script:top.mform("v",4,0,0)" ]) Then
MouseDown("left")
MouseUp("left")
EndIf

MouseMove(xxx,xxx)
If StatusbarGetText("website - windows internet explorer" [, "java script:top.mform("v",4,0,0)" ]) Then
MouseDown("left")
MouseUp("left")
EndIf

MouseMove(xxx,xxx)
If StatusbarGetText("website - windows internet explorer" [, "java script:top.mform("v",4,0,0)" ]) Then
MouseDown("left")
MouseUp("left")
EndIf

MouseMove(xxx,xxx)
If StatusbarGetText("website - windows internet explorer" [, "java script:top.mform("v",4,0,0)" ]) Then
MouseDown("left")
MouseUp("left")
EndIf

Now when i run this script, as the mouse moves over the first link an error pops up saying

If StatusbarGetText("website - windows internet explorer" [, "java script:top.mform("v",4,0,0)" ]) Then
If StatusbarGetText("website - windows internet explorer" ^ ERROR

So i removed the [] brackets and then i get this

If StatusbarGetText("website - windows internet explorer" [, "java script:top.mform("v",4,0,0)" ]) Then
If StatusbarGetText("website - windows internet explorer" [, "java script:top.mform("^ ERROR

Now i think i know whats causing the conflict, those "" in the statusbar message, however unless i have them in then the message isnt detected and thus doesnt work, but if i have them the script wont work either.

What im wondering is if there is any other way i can get the Mouse to Move over the Links, check the statusbar message for the correct message and then click on that link?

Its got 6 options to check and if the correct option is the first checked the other options disappear, so i dont want it to continue checking if it finds the right option.

I hope this is understandable, and any help would be greatly appreciated.

NOTES: I KNOW MOUSEMOVE and the website - internet explorer things arent correct but they arent what is displayed in my script, its just an example, the values in my script are correct.

Edited by Ginseng
Link to comment
Share on other sites

Are you sure that will work considering it doesnt match whats in the statusbar? Oh well.. i'll give it a try, thanks alot.

Right well.. its got rid of the error however it doesnt seem to register the statusbar message, it just continues through the script and doesnt select any option. Do i need more in the If statement than MouseDown MouseUp for it to work?

i've tried

If StatusbarGetText( "webite - Windows Internet Explorer" , "java script:top.mform('v',5,0,0)" , 1 )
Sleep(100)
MouseClick("left" [, xxx, xxx, [, 1]] )
MouseDown("left")
MouseUp("left")

but its just hovering over the options and not issuing the mouseclick or mousedown/up commands on the correct option.

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...