Stefan22 Posted June 16, 2008 Posted June 16, 2008 (edited) Hello, I have a question: "Is it possible to make a script to get something like when im pressing F12 it will automaticly fill in the text/numbers 0123456789?" Some sort of thing with hotkeys. Im kinda new here so dont really know how it has to work. Greetings Stefan EDIT: Got this working now, just need to know how to press a button in a other window Edited June 17, 2008 by Stefan22
Touch Posted June 16, 2008 Posted June 16, 2008 HotKeySet() and Send() [center][font="Arial"]If practise makes perfect and no-ones perfect whats the point of practise?[/font]Sorry for my rude attitude when I started here.[/center]
crashdemons Posted June 16, 2008 Posted June 16, 2008 EDIT: Got this working now, just need to know how to press a button in a other window ControlClick ( "title", "text", controlID) My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)
Stefan22 Posted June 16, 2008 Author Posted June 16, 2008 (edited) Thanks alot, got it almost working now EDIT: Only thing I need to know is where to find the ControlID of the button Edited June 16, 2008 by Stefan22
Stefan22 Posted June 16, 2008 Author Posted June 16, 2008 (edited) Hmmm let me tell u what i have to do ^^ I got a program called Phone Dialer Pro. In this program u can press buttons and call people etc. Now I need to make a script which automaticly starts the program, uses a hotkey to fill in the number 0123456789 and after that press the Dial button. Maybe anyone can help me with this? Greetings Stefan. Edited June 16, 2008 by Stefan22
newbiescripter Posted June 16, 2008 Posted June 16, 2008 This should do the job. Just edit the title of the window and the two control IDs: HotKeySet("{F12}","call") While 1 Sleep(100) WEnd Func call() ControlSend("title of window","","Control ID for the control with the number","0123456789") ; number to call Sleep(200) ControlClick("Title of window","","Control ID of the dial button") ; press the dial button EndFunc Regards
Stefan22 Posted June 16, 2008 Author Posted June 16, 2008 Ok thanks for fast reply, I will give it a try
newbiescripter Posted June 16, 2008 Posted June 16, 2008 Ok thanks for fast reply, I will give it a tryYou do know how to get the control ID and the title. right? if not just use the Autoit window info..Regards
Stefan22 Posted June 16, 2008 Author Posted June 16, 2008 (edited) Yes I think I found that. This is what I have now:Run("C:\Program Files\Phone Dialer Pro2\phonepro.exe") HotKeySet("{F12}","call") While 1 Sleep(100) WEnd Func call() ControlSend("Phone Dialer Pro - "one"","","23","0123456789"); number to call Sleep(200) ControlClick("Phone Dialer Pro - "one"","","7"); press the dial button EndFuncBut when im trying to run this it gives an error the one that autoit3.exe cant be runned and has to close. So for some reason I cant run the script :/EDIT: 'I think' that my program cant run the ControlClick and Controlsend dont know why this is, but its annoying EDIT2: This is how the program looks likehttp://img81.imageshack.us/my.php?image=windowsw3.jpgAnd this is the error I get ps: sorry its in dutch http://img253.imageshack.us/my.php?image=window2dz7.jpg Edited June 16, 2008 by Stefan22
therks Posted June 16, 2008 Posted June 16, 2008 The problem could be the lines that have extra quotes in them, like this part: ControlSend("Phone Dialer Pro - "one"","","23","0123456789"); number to calloÝ÷ Ù'-è¨ïâÆåiÉ"Ë^iÚrhº·NßÛyÆ®±ëaz«¨µ«b¢y®FÞ~ÞÞþ'%¢Ç¬¶¬¶¸§'ò¢ìÛh«Þªê-jبf«È§²'^jËkx2¢èZ½ëhv'zíÂax,+az·h¹¹^¶ªºZ¶*'ªä²X¤zØb°Ú-Ç¡£«*ºjºhꮢڮ¢Ø§²×vêºhꮢ֮¶sd6öçG&öÅ6VæBgV÷CµöæRFÆW"&òÒgV÷C²gV÷C¶öæRgV÷C²gV÷C²gV÷C²ÂgV÷C²gV÷C²ÂgV÷C³#2gV÷C²ÂgV÷C³#3CScsgV÷C²²çVÖ&W"Fò6Æ My AutoIt Stuff | My Github
Stefan22 Posted June 17, 2008 Author Posted June 17, 2008 (edited) Ok thanks I got rid of the errors, but still the F12 button doesnt work :s no idea why this is.. Edited June 17, 2008 by Stefan22
Stefan22 Posted June 17, 2008 Author Posted June 17, 2008 Does anyone know why the script doesn't press the buttons on the program?
Verox743 Posted June 17, 2008 Posted June 17, 2008 (edited) Does anyone know why the script doesn't press the buttons on the program? hmm is there maybe another hotkey set to F12 from the dial program and what you mean by buttons aren't pressed? i guess the ControlSend sends only characters to the window and you controlclick does not seem to specify on a button your like: ControlClick('Phone Dialer Pro - "one"',"","7") But there you dont defined a button that is to be clicked? look for the right command vvv ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] ) after the 3rd " , " comes the button to press but you dont got something for that part.. i never made a gui but i guess thats it Edited June 17, 2008 by Verox743 Started with AutoIt on 12th June, 2008.
Stefan22 Posted June 17, 2008 Author Posted June 17, 2008 (edited) Hmm well, the program doesn't use F12 for anything else. And I can try to make the controlclick like you give it Run("C:\Program Files\Phone Dialer Pro2\phonepro.exe") HotKeySet("{F11}","bellen") While 1 Sleep(500) WEnd Func bellen() MouseClick("left", 754, 307) Send("123456789") Sleep(999) ControlClick ('Phone Dialer Pro - "one"', "", 7 , "left" , 1 , 806 , 572) EndFunc Got this now, but when starting the program it gives in the number wich I have to dial, and it looks like its pressing the button... But it does not dial :s Edited June 17, 2008 by Stefan22
cartman380 Posted June 17, 2008 Posted June 17, 2008 Try showing us the summary text of the button/control you're trying to click.
Stefan22 Posted June 18, 2008 Author Posted June 18, 2008 (edited) >>>> Window <<<< Title: Phone Dialer Pro - "Untitled" Class: ThunderRT5Form Position: 615, 394 Size: 320, 388 Style: 0x16CA0000 ExStyle: 0x00040100 Handle: 0x001D02A6 >>>> Control <<<< Class: ThunderRT5CommandButton Instance: 4 ClassnameNN: ThunderRT5CommandButton4 Advanced (Class): [CLASS:ThunderRT5CommandButton; INSTANCE:4] ID: 7 Text: Position: 12, 274 Size: 111, 57 ControlClick Coords: 56, 22 Style: 0x5C01000B ExStyle: 0x00000004 Handle: 0x001C016E >>>> Mouse <<<< Position: 686, 739 Cursor ID: 0 Color: 0xECE9D8 >>>> StatusBar <<<< >>>> Visible Text <<<< II M M (...) Frame1 >>>> Hidden Text <<<< Edit1: Okay this is it, dont mind the title of it ^^ its Untitled now, should be one but that isn't a problem can change that whenever I want. Edited June 18, 2008 by Stefan22
newbiescripter Posted June 18, 2008 Posted June 18, 2008 This should click the button: ControlClick("Phone Dialer Pro -" , "" , 7 ) See that 7 is not in quotes since it is an ControlID number and not the ClassnameNN Regards
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