Jump to content

send key to not active window


Recommended Posts

Hi everybody,

i need your help with stupid simply command.

I want to send a key to not active window of IE. In this window is 2 combos (month of year). I want to select other month in combo. I use the "down" key but it doesnt works.

skript:

ControlSend("Kalendár", "", "Internet Explorer_TridentCmboBx1", "{down 3}")

it makes 3x down but no in combo. It makes in window - scrool - 3 lines down. :whistle:

pls. help.

why it doesnt works?

thank you very much

Link to comment
Share on other sites

Hi everybody,

i need your help with stupid simply command.

I want to send a key to not active window of IE. In this window is 2 combos (month of year). I want to select other month in combo. I use the "down" key but it doesnt works.

skript:

ControlSend("Kalendár", "", "Internet Explorer_TridentCmboBx1", "{down 3}")

it makes 3x down but no in combo. It makes in window - scrool - 3 lines down. :whistle:

pls. help.

why it doesnt works?

thank you very much

<{POST_SNAPBACK}>

You can't control IE with ControlSend because this function can't see an Object Explorer. The reason while you have three {down } is because Controlsend apply anywhere in the current window .You can have the same result using IE automation by daleHohm

Read that's post IE automation and after you can do what you want

Link to comment
Share on other sites

Oh no. My old problem. I dont have install autoit 3 on my computer. (its in work and i dont have a permission).

But i try it.

I create IE.au3 file - copy the script from your link and insert it in my "include" folder, but its show me error - "Error reading the file: IE.au3"

I run script:

#include <IE.au3>

$o_IE = _IECreate ()

_IENavigate ($o_IE, "http://autoitscript.com")

_IEClickLinkByText ($o_IE, "forum")

_IEClickLinkByText ($o_IE, "Search")

$o_SearchForm = _IEFormGetObjByName ($o_IE, "sForm")

$o_Keywords = _IEFormElementGetObjByName ($o_SearchForm, "keywords")

_IEFormElementSetValue ($o_Keywords, "ReadyState")

_IEFormSubmit ($o_SearchForm)

It is because i dont have instaled Autoit 3???

Or is there other problem ?

thanks

Link to comment
Share on other sites

Replace it with:

#include "C:\Program Files\Autoit\Include\IE.au3"

Replace C:\Program Files\AutoIt\Include\ to wherever the IE.au3 file is located on your harddrive.

<{POST_SNAPBACK}>

yes, it works but, .......... .:whistle:

its shows this error

---------------

Line 776 (File "c:\autoit\include\IE.au3):

If IsObj($o_object.elements) Then

If IsObj($o_object.e-ERROR

Error: Unable to parse line.

---------------------------

Pleeeease help.

it will be very usefull for me, when it will be works...but i have still some problem :dance:

Link to comment
Share on other sites

yes, it works but, .......... .:whistle:

its shows this error

---------------

Line 776 (File "c:\autoit\include\IE.au3):

If IsObj($o_object.elements) Then

If IsObj($o_object.e-ERROR

Error: Unable to parse line.

---------------------------

<{POST_SNAPBACK}>

Are yo using the latest Beta? If not, then you can get it here: http://www.autoitscript.com/forum/index.php?showtopic=10256

It is needed, cause only the Beta is able to use COM-Objects.

Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer
Link to comment
Share on other sites

ok now its all works but

i dont find out, how i use this IE function

f.e.

i wont to click on button, but i don know how i define it

or combo box

i try to use

$oFrom = _IEFormGetObjByName($oIE, "sForm")

but it doesnt works

$oFrom = _IEFormGetObjByName($oIE, "sForm")

with AU3info i find info about window out, but which variables are?

sorry for my english :whistle:

thanks

Link to comment
Share on other sites

Search for the Form which Button you want to press.

Ex: <form action="http://www.autoitscript.com/forum/index.php?" method="post" name="search">

Look for the Name.

Then get the Form-Object like this.

$oForm = _IEFormGetObjByName($oIE, "search")

if it is a Submit button you want to click

Ex: <input type="submit" value="Search Topic" class="button" />

just use the following code:

_IEFormSubmit($oForm)

If it isn't a Submit Button

Ex: <input type="button" name="qrc" >

Then use the following code to get the Object for this Button:

$oButton = _IEFormElementGetObjByName($oIE, "qrc")

Then just invoke the following code:

$oButton.click

Great isn't it :whistle:

Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer
Link to comment
Share on other sites

sorry but from where you have this info?

Ex: <input type="submit" value="Search Topic" class="button" />

In AU3Info.exe is only class information. Or it depends, what i want?

f.e.: i want to click on "submit button", so i choose this example?

Concrete. I need to 3x send "down key" in combo box, but i dont know, define it. :whistle:

this info i have in au3info

-----------------

Press CTRL-ALT-F to pause the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Kalendár - Microsoft Internet Explorer

Class: IEFrame

Size: X: 0 Y: 3 W: 850 H: 700

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 162 Y: 258

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xDCEDFD Dec: 14478845

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 131 Y: 214 W: 41 H: 22

Control ID: 57

ClassNameNN: Internet Explorer_TridentCmboBx2

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

(1): Done

(2):

(3):

(4):

(5):

(6): Local intranet

--------------

Can i use this info, or i no use InfoAU3 at all?

thanks for help :dance:

Link to comment
Share on other sites

sorry but from where you have this info?

Ex: <input type="submit" value="Search Topic" class="button" />

This is HTML Code. You get it by a right click -> Show source on the webpage you want to investigate, and then you can search for type="submit".

In  AU3Info.exe is only class information. Or it depends, what i want?

f.e.: i want to click on "submit button", so i choose this example?

AU3Info is unable to get the Control Informations of Webpage element, so it would never help you in scripting a Webpage.

Concrete. I need to 3x send "down key" in  combo box, but i dont know, define it.

<{POST_SNAPBACK}>

Hopefully for you the Combobox also has a name attribute (Ex. name="combo1")

Then you can select it with: $oCombo = _IEFormElementGetObjByName($oIE, "combo1")

Then how to set the Focus to it I don't know... Maybe a $oCombo.Focus (didn't test) I never had to mess with comboboxes on webpages... Read trough the IE.au3, there are so descriptions which might help you.

Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer
Link to comment
Share on other sites

HTML i dont know :whistle:

its a pity

<{POST_SNAPBACK}>

You don't have to know how to write HTML. Just search for a Line looking similar to my example. You only need the name of the element you want to adress. And this name can you find if you investigate the HTML-Sourcecode.

But yes. Tell us which page you want to automate maybe we can help you there...

Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer
Link to comment
Share on other sites

Rally thanks for your goodlwill boys.

But this is not a i-net web, this is our intranet in my work and it is an Aplication names Calendar. (see on picture. )

I want get up work with combos and buttons and so...Rally thanks for your goodlwill boys.

Or is easear possibility to send key to not activ IE window ?

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