Jump to content

ControlSend and ControlCommand


DeltaRocked
 Share

Recommended Posts

Hi All,

I am facing a problem with ControlCommand.

Synopsis is as follows

Send(1) works under any circumstances.

ControlSend($Str, "", $ctrl,'2') also works ...

But ControlCommand Doessnt seems to work when inserting text in browser's html page

In IE it does work but only for edit regions.

Where am I going wrong?

Instead of using Send or ControlSend, I want to know is there any other way to send characters to the cursor position?

Any help or suggestion is welcome. Just need a way ...

Regards

Deltarocked

$Str = 'Google - Mozilla Firefox'
;$Str = 'Google - Windows Internet Explorer' ; in case u r using Internet Explorer.
WinWaitActive($Str)
Sleep(3000)
$ctrl = ControlGetFocus($Str)
$handle = ControlGetHandle($Str, "", $ctrl)
Send(1)
ControlSend($Str, "", $ctrl,'2')
ControlCommand($Str, "", $ctrl, "EditPaste",'3')
ControlCommand($Str, "", $ctrl, "EditPaste",'4')
MsgBox(0,'',$ctrl&' -- '&$handle)
Edited by deltarocked
Link to comment
Share on other sites

Read the part in my signature about bumping posts.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

You are using control commands on a window, not a control, so it works. AutoIt cannot 'see' into a html page regardless of the browser. Use the AutoIt info tool and you will see what I mean.

Have a look at the IE Library in the help file. There is also a FF library in the Example Script section.

Looking at the code, I would suspect $ctrl and $handle are equal. If they are not equal then $handle will be the high level container that the html is rendered in. WinList would prove this.

Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]

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