Sign in to follow this  
Followers 0
xuzo

Shortcut key not working in Firefox

10 posts in this topic

Line 4 works but using the shortcut line 3 doesn't work, just wondering what I'm doing wrong...!

Trying to use ! instead of ALT in firefox

Opt("WinTitleMatchMode", 2)
WinActivate("Mozilla Firefox", "")
ControlSend("Mozilla Firefox", "", "", "{!f}")
ControlSend("Mozilla Firefox", "", "", "{Altdown}f")

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

{} is ment for keyboard hey name, like you used it in {Altdown}, if you write {Hello} there isnt any key on keyboard named hello

and there isnt key named {!f} on keyboard, is there? ;)

needless to say why dont you try with

ControlSend("Mozilla Firefox", "", "", "!f")

to see if itl work?

and pls pay attention to last parrametar [flag] for ControlSend() and Send() command in help file if you do need to realy send {!} like ! ;)

Edit: ouh and take look at WinMenuSelectItem() command from help file, youl finde it its realy interesting.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

Of course:

ControlSend("Mozilla Firefox", "", "", "!f") works fine!

Thanks, I haven't used AutoIT for months so getting rusty...just a stupid syntax mistake....

Share this post


Link to post
Share on other sites

Hi BogQ,

I've looked at the help files for the WinMenuSelectItem(), tried to make it work with the exact same syntax as the help files, but not working, please have a look at my code, something wrong for sure but can't figure it out! ;(

Opt("WinTitleMatchMode", 2)
WinActivate("Mozilla Firefox", "")
WinMenuSelectItem("Mozilla Firefox", "", "&Edit" [, "&Select All" [, "&Edit" [, "&Copy"]]])

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

this is just off the top of my head, but i don't think FF will respond to WinMenuSelectItem() - did you check what WinMenuSelectItem() is returning?

FF is not a typical GUI like IE, notepad, etc., and this causes problems automating it. you can verufy this by inspecting FF with the AutoIt windows info tool. i think i recall a FF UDF somewhere (check example scripts) that attempted to circumvent this problem

to do what you want, you might be better off with WinActivate(), Send("^a"), Send("^c")

Edited by iCode

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Share this post


Link to post
Share on other sites

Here is my attempt in Notepad, fail!...

WinMenuSelectItem("[CLASS:Notepad]", "", "&Edit" [, "&Select All" [, "&Edit" [, "&Copy"]]])

Share this post


Link to post
Share on other sites

couple things you did wrong - the brackets "[ ]" in function descriptions indicate an optional parameter, so if you choose to include an optional parameter, fine, but you don't use the brackets. if you don't, you just eliminate that part completely

also read the descrip carefully and look at the examples and you'll understand why you need 2 instances of WinMenuSelectItem()

also, the "&" char needs to go exactly before the underlined char in the menu ("Select &All")

$a = WinMenuSelectItem("Untitled - Notepad", "", "&Edit" , "Select &All")
$b = WinMenuSelectItem("Untitled - Notepad", "", "&Edit" , "&Copy")

ConsoleWrite($a & @LF & $b & @LF)

FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Share this post


Link to post
Share on other sites

Hi Icode,

Works fine but no underline under my items in both WordPad and Notepad...I tried with the AutoIt info tool but can't find any info.

How do I know where to put the & and what to use if there are no underlines?

post-73961-0-59663700-1348017718_thumb.j

Share this post


Link to post
Share on other sites

no underline because option to show shortcut keys is turned off in Windows. this is where it's at in 7...

Control PanelAll Control Panel ItemsEase of Access CenterMake the keyboard easier to use


FUNCTIONS: WinDock (dock window to screen edge) | EditCtrl_ToggleLineWrap (line/word wrap for AU3 edit control) | SendEX (yet another alternative to Send( ) ) | Spell Checker (Hunspell wrapper) | SentenceCase (capitalize first letter of sentences)

CODE SNIPPITS: Dynamic tab width (set tab control width according to window width)

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Yes, that was it, easy to change in good old XP ;)

post-73961-0-90309000-1348025983_thumb.j

Edited by xuzo

Share this post


Link to post
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
Sign in to follow this  
Followers 0