Source language: Translate to:

SendKeys command in WebBrowser object

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

SendKeys command in WebBrowser object

Postby fkapnist » Mon Aug 17, 2015 7:39 pm

In my Neobook application I have an object called WebBrowser1. I want to run a SendKeys command only in WebBrowser1.
If for example I use SendKeys "" "{Down}" any other program window that is on top or active will also respond according to the SendKeys command (which I don't want to do). If I use SendKeys "AppID" "{Down}" my Neobook application steps through its own pages (which I don't want it to do). How can I run a SendKeys command only in WebBrowser1 ?


:?:

.
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece

Re: SendKeys command in WebBrowser object

Postby Tony Kroos » Mon Aug 17, 2015 10:57 pm

You will need a custom plugin designed to send key messages to a given window handle.
But, since it's a WebBrowser... do you really need sendkeys? It looks like a silly workaround to me, BrowserExecScript is all you need to deal with browser.
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Re: SendKeys command in WebBrowser object

Postby fkapnist » Tue Aug 18, 2015 2:34 am

Tony Kroos wrote:You will need a custom plugin designed to send key messages to a given window handle.
But, since it's a WebBrowser... do you really need sendkeys? It looks like a silly workaround to me, BrowserExecScript is all you need to deal with browser.


Thanks Tony !

This works quite well and does not affect other windows:

SetVar "[status]" "Scrolling Down"
SetVar "[loop]" "1"
While "[loop]" "=" "1"
Delay "1000"
BrowserExecScript "WebBrowser1" "window.scrollBy(0, 100);" "JScript"
EndWhile



:)
User avatar
fkapnist
 
Posts: 348
Joined: Mon Nov 17, 2014 4:24 pm
Location: Greece


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest