xuzo Posted September 18, 2012 Share Posted September 18, 2012 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 Link to comment Share on other sites More sharing options...
bogQ Posted September 18, 2012 Share Posted September 18, 2012 (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 September 18, 2012 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) 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. Link to comment Share on other sites More sharing options...
xuzo Posted September 18, 2012 Author Share Posted September 18, 2012 Of course: ControlSend("Mozilla Firefox", "", "", "!f") works fine! Thanks, I haven't used AutoIT for months so getting rusty...just a stupid syntax mistake.... Link to comment Share on other sites More sharing options...
xuzo Posted September 18, 2012 Author Share Posted September 18, 2012 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"]]]) Link to comment Share on other sites More sharing options...
iCode Posted September 18, 2012 Share Posted September 18, 2012 (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 September 18, 2012 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) Link to comment Share on other sites More sharing options...
xuzo Posted September 18, 2012 Author Share Posted September 18, 2012 Here is my attempt in Notepad, fail!... WinMenuSelectItem("[CLASS:Notepad]", "", "&Edit" [, "&Select All" [, "&Edit" [, "&Copy"]]]) Link to comment Share on other sites More sharing options...
iCode Posted September 19, 2012 Share Posted September 19, 2012 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 completelyalso 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) Link to comment Share on other sites More sharing options...
xuzo Posted September 19, 2012 Author Share Posted September 19, 2012 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? Link to comment Share on other sites More sharing options...
iCode Posted September 19, 2012 Share Posted September 19, 2012 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) Link to comment Share on other sites More sharing options...
xuzo Posted September 19, 2012 Author Share Posted September 19, 2012 (edited) Yes, that was it, easy to change in good old XP Edited September 19, 2012 by xuzo Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now