Khoneini Posted March 19, 2013 Share Posted March 19, 2013 All, I need to change the behaviour of a couple of AutoIT script written by our previous System/Appliacation engineer. Thank god he did leave the Source code files behind on the shares and I'm trying to identify what the script is actually doing. There are a couple of references which I can't find back in the script. I'll list a couple below: 1. SEND("!ans{ENTER}") 2. CONTROLFOCUS("WINDOWNAMEREMOVED","","Button8") CONTROLCLICK("WINDOWNAMEREMOVED","","Button8") 3. CONTROLFOCUS("WINDOWNAMEREMOVED","","Button7") CONTROLCLICK("WINDOWNAMEREMOVED","","Button7") When it does perform the code listed above under "1." It does perform 3 actions: Within the application it goes to Transaction -> Inventory -> Series Post This is in the Menu bar of the application Where does it get the !ans value? Then the code listen under "2." and "3.", I know what CONTROLFOCUS and CONTROLCLICK does. What I don't understand is how it can find "Button8" and "Button7". "Button 7" is simply a CANCEL button from a screen but "Button 8" is a custom made button within the application so how does AutoIT know what "Button8" is? I don't see any references in the AutoIT Script which defines the location of these buttons. The only show up in the CONTROLFOCUS and CONTROLCLICK command. Please help me out. Any help is appreciated. Link to comment Share on other sites More sharing options...
Jfish Posted March 19, 2013 Share Posted March 19, 2013 You should probably post all your code. That said, read the AutoIt Appendix for sendkey values. I believe "!ans{Enter} is: ALT+a+n+s+Enter. Variables in AutoIt start with "$" so that is not a variable.The buttons are controlIds - read the functions in the manual to see the arguments: ControlFocus ( "title", "text", controlID). Look at the rest of the code for references to those controls. Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
Khoneini Posted March 19, 2013 Author Share Posted March 19, 2013 (edited) You should probably post all your code. That said, read the AutoIt Appendix for sendkey values. I believe "!ans{Enter} is: ALT+a+n+s+Enter. Variables in AutoIt start with "$" so that is not a variable. The buttons are controlIds - read the functions in the manual to see the arguments: ControlFocus ( "title", "text", controlID). Look at the rest of the code for references to those controls. Thanks for your reply. You were right about the !ans{Enter} I tried this command manually and that makes sence to me, did the same as the script does. About the "Button8" / "Button7" I've no idea how AutoIT does recognize the right button. Please advice. Script can be found below: CONTROLFOCUS("Microsoft Dynamics GP","","Button8") CONTROLCLICK("Microsoft Dynamics GP","","Button8") ;CLICK CANCEL ON REPORT DESTINATION WINDOWS WINWAITACTIVE("Report Destination","",10) CONTROLFOCUS("Report Destination","","Button7") CONTROLCLICK("Report Destination","","Button7") WINWAITACTIVE("Report Destination","",10) CONTROLFOCUS("Report Destination","","Button7") CONTROLCLICK("Report Destination","","Button7") WINWAITACTIVE("Report Destination","",10) CONTROLFOCUS("Report Destination","","Button7") CONTROLCLICK("Report Destination","","Button7") WINWAITACTIVE("Report Destination","",10) CONTROLFOCUS("Report Destination","","Button7") CONTROLCLICK("Report Destination","","Button7") WINWAITACTIVE("Report Destination","",10) CONTROLFOCUS("Report Destination","","Button7") CONTROLCLICK("Report Destination","","Button7") WINWAITACTIVE("Report Destination","",10) CONTROLFOCUS("Report Destination","","Button7") CONTROLCLICK("Report Destination","","Button7") WINWAITACTIVE("Report Destination","",10) CONTROLFOCUS("Report Destination","","Button7") CONTROLCLICK("Report Destination","","Button7") WINWAITACTIVE("Report Destination","",10) CONTROLFOCUS("Report Destination","","Button7") CONTROLCLICK("Report Destination","","Button7") Edited March 20, 2013 by Khoneini Blanked username and password Link to comment Share on other sites More sharing options...
Khoneini Posted March 20, 2013 Author Share Posted March 20, 2013 Is there someone that can assist me with this. Any help is appreciated. I know what CONTROLFOCUS and CONTROLCLICK does. I just only don't understand how AutoIT does recognize what Button7 & Button 8 is. I can't find any reference in the script for these 2 buttons. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 20, 2013 Moderators Share Posted March 20, 2013 Khoneini, I have blanked the username and password you had in the script above - not a good idea to publish them on t'InterWeb. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Khoneini Posted March 20, 2013 Author Share Posted March 20, 2013 Khoneini,I have blanked the username and password you had in the script above - not a good idea to publish them on t'InterWeb. M23Thanks for that, it is a TEST account so I'm lucky with that one, I've removed some parts of the script but I still don't understand how AutoIT does know what "Button7" and "Button8" means. Is this normal? The "Button7" is a Cancel button and "Button8" is a custom-made application button, so there is no way AutoIT can know this button already... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 20, 2013 Moderators Share Posted March 20, 2013 Khoneini,Open the AutoIt Window Info tool (you find it at C:Program FilesAutoIt3Au3Info.exe if you did a standard install) and drag the gunsight over the GUI. You will see the details of the various controls appear in the tool window - you will probably need to select the "Control" tab. See what you get when you look at the 2 buttons you mention - I imagine it will answer your question. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Khoneini Posted March 21, 2013 Author Share Posted March 21, 2013 Khoneini,Open the AutoIt Window Info tool (you find it at C:Program FilesAutoIt3Au3Info.exe if you did a standard install) and drag the gunsight over the GUI. You will see the details of the various controls appear in the tool window - you will probably need to select the "Control" tab. See what you get when you look at the 2 buttons you mention - I imagine it will answer your question. M23It does! Thank you so much!! 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