Jump to content

Recommended Posts

Posted (edited)

What the script needs for to click on "enter" in the address bar of FF only?

If you can not use the mouse.

Address is already written.

Edited by zxc3
Posted

Send("{ENTER}")

it does not work because you need something

ControlSend ("untiled","",'^ L ')

ControlSend ("untiled","","{ ENTER}")

Where is the mistake?

Posted (edited)

Send("!d")

Send("{ENTER}")

Thanks, but I have already opened a window http://www.bbc.co.uk/, but adress is not pressed- an error, where?

AutoItSetOption("WinTitleMatchMode",4)

Global $handle

#include <FF.au3>

$handle = WinGetHandle("BBS - Homepage")

;WinClose($handle)

ControlSend($handle,"!d")

ControlSend($handle, "{ENTER}")

controlsend -error?

Edited by zxc3
Posted

Thanks, but I have already opened a window http://www.bbc.co.uk/, but adress is not pressed- an error, where?

AutoItSetOption("WinTitleMatchMode",4)

Global $handle

#include <FF.au3>

$handle = WinGetHandle("BBS - Homepage")

;WinClose($handle)

ControlSend($handle,"!d")

ControlSend($handle, "{ENTER}")

How to properly must be written ControlSend() functions?

Posted (edited)

How about:

$hFFWindow=WinGetHandle("[CLASS:MozillaUIWindowClass]")
$hFFControl=ControlGetHandle($hFFWindow,"","[CLASS:MozillaWindowClass; INSTANCE:1]")
WinActivate($hFFWindow)
ControlSend($hFFWindow,"",$hFFControl,'^l')
ControlSend($hFFWindow,"",$hFFControl,'{ENTER}')
Edited by Ascend4nt
Posted

How about:

$hFFWindow=WinGetHandle("[CLASS:MozillaUIWindowClass]")
$hFFControl=ControlGetHandle($hFFWindow,"","[CLASS:MozillaWindowClass; INSTANCE:1]")
WinActivate($hFFWindow)
ControlSend($hFFWindow,"",$hFFControl,'^l')
ControlSend($hFFWindow,"",$hFFControl,'{ENTER}')

Thanks a lot, but I do not understand everything.

1.I have already opened page.

2.Then the script is run , it chooses this page with Name and ID.

3.Sends to the address bar of the desired character-"enter"

and so on...

Posted (edited)

Why do need WinActivate ()?

But with it and without it characters are not transmitted in the address bar.

Edited by zxc3
Posted

Why do need WinActivate ()?

But with it and without it characters are not transmitted in the address bar.

When I put the cursor at the end of the address, the script works, but added "l" at the end of the address. How to send CTRL L?
Posted

If this is indeed Firefox you are talking about, the code I posted should have worked. However, I'm not certain if keyboard shortcuts are different for your country. You might even have different window classes showing up for Firefox (check with the AutoIt info tool).

Also, if your PC is very fast, perhaps you need to change the key delay options. Here's an alternate version:

Opt("SendKeyDelay",0)
 Opt("SendKeyDownDelay",0)
$hFFWindow=WinGetHandle("[CLASS:MozillaUIWindowClass]")
WinActivate($hFFWindow)   ; Window must be active
SendKeepActive($hFFWindow)   ; This tries to keep all subsequent Send()'s directed at the given window
Send('^l')
Send("{ENTER}")
Posted (edited)

If this is indeed Firefox you are talking about, the code I posted should have worked. However, I'm not certain if keyboard shortcuts are different for your country. You might even have different window classes showing up for Firefox (check with the AutoIt info tool).

Also, if your PC is very fast, perhaps you need to change the key delay options. Here's an alternate version:

Opt("SendKeyDelay",0)
 Opt("SendKeyDownDelay",0)
$hFFWindow=WinGetHandle("[CLASS:MozillaUIWindowClass]")
WinActivate($hFFWindow)   ; Window must be active
SendKeepActive($hFFWindow)   ; This tries to keep all subsequent Send()'s directed at the given window
Send('^l')
Send("{ENTER}")

Still not working, although in manual mode ctrl + L works with any keyboard layout.

Can the FF setting affect this? What is different manual input from the input through a script?

ControlSend($hFFWindow,"",$hFFControl,"{ASC 012}")-too...

post-6124-0-10108000-1289241117_thumb.jp

Edited by zxc3
Posted

Both "^l", and "!d" do the same for me either manually or with Send().

In manual mode, alt+d on the English keyboard layout switches to the address bar,

and the Russian switches on the menu - View.

But in the script, I can not transmit any control character in the address bar of FF.

Is your window visible and active?

Yes

Why do you use wintitlematchmode 4, and then go on to use a partial title?, try mode 2.

it is changes nothing
Posted

 zxc3, in your post #5 try to change 

$handle = WinGetHandle("BBS - Homepage")
with 
$handle = WinGetHandle("BBC - Homepage")
.

thanks, but I did not understand

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
×
×
  • Create New...