Sign in to follow this  
Followers 0
KonnectTest

Sending mouse click command to button that has focus

7 posts in this topic

#1 ·  Posted (edited)

Hi,

Is it possible to send a mouse click command to a button that has focus? I am setting focus to the button by tabbing to it. I cannot rely on mouse coordinates as I wish to run the script on different computers with different resolutions etc. Unfortunately I am unable to "click" the button using space, enter or any other keys for that matter. :-(

Also, I cannot set focus to the button using using controlFocus (and hence controlClick) as the button resides in an ActiveX component and therefore cannot be identified.

Thanks

Edited by KonnectTest

Share this post


Link to post
Share on other sites



Try ControlClick() either with "" for the ControlID, or just use the ID of the ActiveX control.

:D


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

Try ControlClick() either with "" for the ControlID, or just use the ID of the ActiveX control.

:D

Thanks for your reply. Unfortunately no variations of your suggestion worked. :-( The best result I achieved was a "click" which seemed like it was right in the middle of the page.

Share this post


Link to post
Share on other sites

Post what you get on the Summary tab of the AutoIt Window Info Tool (AU3Info.exe) when you look at that control.

:D


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

Post what you get on the Summary tab of the AutoIt Window Info Tool (AU3Info.exe) when you look at that control.

:D

Screenshot attached.

post-55955-12657624994067_thumb.jpg

Share this post


Link to post
Share on other sites

Ah, snap! That makes it easy. What you have is an embedded instance of IE. Look in the help file at the _IE* functions of Dale's IE.au3 UDF. Get an object reference to the embedded browser with _IEAttach() and handle it like you would any other IE web page automation.

$oIE = _IEAttach("New Request Form", "Embedded")

:D


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

Alright, I'll give this a go. I think it might require a bit of up-skilling on my part. :-)

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