Abhay Posted December 15, 2008 Posted December 15, 2008 Can I send keys like {ENTER} or {TAB} or "!a" etc by using ControlSend()? I want to navigate through different screens so let me know if I can do that.
KaFu Posted December 15, 2008 Posted December 15, 2008 ControlSend works in a similar way to Send...and yes it does send shift, ctrl, alt etc. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
KaFu Posted December 15, 2008 Posted December 15, 2008 Can I do controlsend based on object ID? ControlSend ( "title", "text", controlID, "string" [, flag] ) You can obtain the Title and controlID with the AU3Info Tool (Au3InfoA.exe) located in the au3 install dir. Best Regards OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Abhay Posted December 15, 2008 Author Posted December 15, 2008 Whats the significance of flag "0" and "1". I tried that but it didn't work. ControlSend("CommandCentral", "Next", 3668, "{ENTER}", 0)
Andreik Posted December 15, 2008 Posted December 15, 2008 Whats the significance of flag "0" and "1".I tried that but it didn't work.ControlSend("CommandCentral", "Next", 3668, "{ENTER}", 0)0 is you want to send special text like SHIFT, ALT and other like this.1 is if you want to send raw text.
Abhay Posted December 15, 2008 Author Posted December 15, 2008 ControlSend("CommandCentral", "Next", 3668, "{ENTER}", 0) Here I am trying to send Enter to Next button, why it is not happening?
KaFu Posted December 15, 2008 Posted December 15, 2008 The syntax looks right, so I guess the control can not be found. If msgbox(0,"",ControlSend("CommandCentral", "Next", 3668, "{ENTER}", 0)) gives you a 0 that's the case. Maybe try ControlSend("CommandCentral", "&Next", 3668, "{ENTER}", 0) or ControlSend("CommandCentral", "", 3668, "{ENTER}", 0) OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
jvanegmond Posted December 15, 2008 Posted December 15, 2008 The second parameter "Text" is not used to find the control, but it is used to find the window. Entering "Next" there will cause it to fail to find the window. ControlSend("CommandCentral", "", 3668, "{ENTER}") github.com/jvanegmond
KaFu Posted December 15, 2008 Posted December 15, 2008 The control might first need to be given focus with the ControlFocus command, specially when referencing an controlID created by the script itself.? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Trait Posted December 15, 2008 Posted December 15, 2008 Tried those things guys, still not!Try removing all references to a specific program from your ControlSend()IE:ControlSend("NotePad","","","TestTest")I've had a few video games I was making bots for that didn't have controls to get, and the command still works without it.
Abhay Posted December 15, 2008 Author Posted December 15, 2008 For notepad its easy as we are just sending text. What I want to accomplkish here is that there is a button next, I want to send ENTER to it to go to the next screen. Any idea?
Abhay Posted December 15, 2008 Author Posted December 15, 2008 >>>> Window <<<< Title: CommandCentral Class: #32770 Position: 193, 128 Size: 639, 478 Style: 0x94CA02C4 ExStyle: 0x00010101 Handle: 0x00050398 >>>> Control <<<< Class: Button Instance: 11 ClassnameNN: Button11 Advanced (Class): [CLASS:Button; INSTANCE:11] ID: 3668 Is this enough?
PsaltyDS Posted December 15, 2008 Posted December 15, 2008 >>>> Window <<<< Title: CommandCentral Class: #32770 Position: 193, 128 Size: 639, 478 Style: 0x94CA02C4 ExStyle: 0x00010101 Handle: 0x00050398 >>>> Control <<<< Class: Button Instance: 11 ClassnameNN: Button11 Advanced (Class): [CLASS:Button; INSTANCE:11] ID: 3668 Is this enough? ControlClick("CommandCentral", "", "Button11") I guess you could try ControlSend(), but why? ControlClick() is the usual way to click a button control. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Abhay Posted December 16, 2008 Author Posted December 16, 2008 ControlClick("CommandCentral", "", "Button11") I guess you could try ControlSend(), but why? ControlClick() is the usual way to click a button control. ControlClick("CommandCentral", "", "Button11") <----------------- This doesn't work, did you try it at your end?
PsaltyDS Posted December 16, 2008 Posted December 16, 2008 ControlClick("CommandCentral", "", "Button11") <----------------- This doesn't work, did you try it at your end?I have used ControlClick() many times, yes. But I don't know what "CommandCentral" is, so I couldn't test it in that context. What is the app you are working with? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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