Chad_C Posted August 31, 2016 Posted August 31, 2016 Alright, here's my conundrum. I want to make a GUI with blank spaces that another user can input their text into and have it complete the process. I want to have these boxes be called for information to be entered, without the user needing to modify the script itself. This would be –highly- useful for short term/high volume but simple repetitive tasks for those with no coding experience. For example (can reference photo example – it is only a quick mock up in a photo program) Code steps for starting a web browser and navigating to a webpage Enter [___] for user name Key press Tab Enter [___] for password Key press Enter And so on. I’ve done the coding for the specific places/mouse clicks, menus, tabs, sleep timers, no problem for similar things. I’m hoping the GUI is possible so I can hand off to other users in my area who don’t have my (limited) coding experience to increase productivity. Thank you so much!
Moderators JLogan3o13 Posted August 31, 2016 Moderators Posted August 31, 2016 @Chad_C is there a question in there somewhere? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
AutoBert Posted August 31, 2016 Posted August 31, 2016 Show script, no picture. A script is extended by a few lines. With picture help willing people must script the GUI.
Chad_C Posted September 1, 2016 Author Posted September 1, 2016 Apologies for the poor phrasing, I'll try again I've included the script I've been running for myself with annotations attached. I'm like a healthcare educator, and this example is for our training environment and preloading materials for a class to use/chart against. The Problem: It's a short repetitive task for placing specific orders. It works fine for me, but I know where to tweak it when I need something different The script functions for my coworkers, but they don't know enough about coding to edit the script, and if I had time to sit with 10 other people and do the small tasks or teach them the basic code to edit... Script Thought Process I've the beeps to let me know audibly it has actually started running Sleep to give me(or the user) enough time to let go of their mouse PreOrder for the clicks and prep to get to the screen where the input is needed Order1 for what I want typed in Post order to wrap it up and be ready for the next series, should I want it. SignOrder to close the series and tie loose ends. The Questions: How do I code for a GUI so I can pass this to my coworkers, with the intention that I'll replace "Order1-6" with whatever is placed in the blank space? Several tutorials have given very good GUI boxes with different dimensions and functions, but nothing has reference how to have an input box and how to make it work. Struggling to find the information for myself, not sure where to go to get either direction or more information. Is second attempt at asking clearer? Orders Code.txt
Kaimberex Posted September 1, 2016 Posted September 1, 2016 (edited) 11 minutes ago, Chad_C said: Apologies for the poor phrasing, I'll try again I've included the script I've been running for myself with annotations attached. I'm like a healthcare educator, and this example is for our training environment and preloading materials for a class to use/chart against. The Problem: It's a short repetitive task for placing specific orders. It works fine for me, but I know where to tweak it when I need something different The script functions for my coworkers, but they don't know enough about coding to edit the script, and if I had time to sit with 10 other people and do the small tasks or teach them the basic code to edit... Script Thought Process I've the beeps to let me know audibly it has actually started running Sleep to give me(or the user) enough time to let go of their mouse PreOrder for the clicks and prep to get to the screen where the input is needed Order1 for what I want typed in Post order to wrap it up and be ready for the next series, should I want it. SignOrder to close the series and tie loose ends. The Questions: How do I code for a GUI so I can pass this to my coworkers, with the intention that I'll replace "Order1-6" with whatever is placed in the blank space? Several tutorials have given very good GUI boxes with different dimensions and functions, but nothing has reference how to have an input box and how to make it work. Struggling to find the information for myself, not sure where to go to get either direction or more information. Is second attempt at asking clearer? Orders Code.txt Familiarize yourself with Koda Form Designer, available with the full version of AutoIt Full Installation and the AutoIt Script Editor.(Customised version of SciTE with lots of additional coding tools for AutoIt) https://www.autoitscript.com/site/autoit/downloads/ Koda will let you create a form assign handles and generate the code for you and you just paste it into your script. Assign handles to your buttons and include a case statement in your While Loop for your button. Assign a function to that button. Also the help file has lots of example code for the GUI stuff. Edited September 1, 2016 by Kaimberex
Moderators JLogan3o13 Posted September 1, 2016 Moderators Posted September 1, 2016 7 minutes ago, Chad_C said: Is second attempt at asking clearer? Better than the "clear as mud" first attempt, but let's try some further clarification. Please confirm whether these assumptions are correct: You want to provide a GUI to your colleagues, where they can type in the order number and then hit a button. That button would then call the function you have in your attached script. Does that about sum it up? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Chad_C Posted September 1, 2016 Author Posted September 1, 2016 4 minutes ago, Kaimberex said: Familiarize yourself with Koda Form Designer Good to know, I'll see if I have ability to access that. 3 minutes ago, JLogan3o13 said: Better than the "clear as mud" first attempt, but let's try some further clarification. Please confirm whether these assumptions are correct: You want to provide a GUI to your colleagues, where they can type in the order number and then hit a button. That button would then call the function you have in your attached script. Does that about sum it up? Yessir Kaimberex 1
Moderators JLogan3o13 Posted September 1, 2016 Moderators Posted September 1, 2016 So, I would begin by looking at GUICreate in the help file. Look at this example as a framework: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 300, 300) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd From there I would do some reading through the help file for the controls that you would like. For example, if you would like them to type in Order1, Order2, etc., you can go with an input control: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 300, 300) $inpOrder = GUICtrlCreateInput("Enter your Order", 10, 10, 280, 40) $btnGo = GUICtrlCreateButton("Go", 250, 250, 40, 40) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $btnGo Switch GUICtrlRead($inpOrder) Case "Order 1" ;Call Order1 Case "Order 2" ;Call Order 2 EndSwitch EndSwitch WEnd Alternatively, you can just create a combo box for the users to choose from: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 300, 300) $comboOrder = GUICtrlCreateCombo("", 10, 10, 280, 25) GUICtrlSetData($comboOrder, "Order 1|Order 2|Order 3") $btnGo = GUICtrlCreateButton("Go", 250, 250, 40, 40) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $btnGo Switch GUICtrlRead($comboOrder) Case "Order 1" ;Call Order1 Case "Order 2" ;Call Order 2 EndSwitch EndSwitch WEnd That should give you some ideas. Take a spin through the help file to look at the other GUI controls, you may find something you hadn't even considered. Kaimberex and Chad_C 2 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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