×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Send Mouse Clicks to IE (... Like oWSH.SendKeys() sends keys)?
2

Send Mouse Clicks to IE (... Like oWSH.SendKeys() sends keys)?

Send Mouse Clicks to IE (... Like oWSH.SendKeys() sends keys)?

(OP)
... I would like to open a drop down list which seems to require a mouse click ...

CODE -->

oWSH = CREATEOBJECT("wscript.shell")
oWSH.AppActivate("Google Chrome")   && assumes Google Chrome is running
oWSH.SendKeys('{TAB}')	&& tab to a dropdown list ... but to drop it down seems to require a mouse click 

Do any of you know how to make a list open in IE (Google) ... that seems to require a click?
Or do you know a work-around to get a list to open (drop down) in IE (Google)?

Utmost thanks in advance,
Philip

RE: Send Mouse Clicks to IE (... Like oWSH.SendKeys() sends keys)?

(OP)
Thanks Mike,

I may be able use an IE dom workaround with this.

So I gather sendkeys() cannot send a mouse click, especially in Chrome.

Utmost thanks/blessings,
Philip

RE: Send Mouse Clicks to IE (... Like oWSH.SendKeys() sends keys)?

You cannot use SendKeys() to send a mouse click, but there is nearly always a keyboard alternative. In most cases, sending Enter when a dropdown has focus is the same as clicking with the mouse. (At least, that's true with FireFox, so probably with Chrome as well.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: Send Mouse Clicks to IE (... Like oWSH.SendKeys() sends keys)?

(OP)
Thanks Mike, I will keep trying (most IE dropdown lists respond to <enter>, this is more of a dropdown browser ('guised as a dropdown list)

Utmost thanks/blessings!
Philip

RE: Send Mouse Clicks to IE (... Like oWSH.SendKeys() sends keys)?

Philip,

For what it's worth, I just tried your code with Chrome. Sending ENTER works fine.

This is what I did:

CODE -->

oWSH = CREATEOBJECT("wscript.shell")
oWSH.AppActivate("Google Chrome")   && assumes Google Chrome is running
oWSH.SendKeys('{TAB}')	            && assumes focus is on control before the drop-down
oWSH.SendKeys('{ENTER}') 

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close