Chad_C

AutoIT GUI

8 posts in this topic

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)

  1. Code steps for starting a web browser and navigating to a webpage

  2. Enter [___] for user name

  3. Key press Tab

  4. Enter [___] for password

  5. Key press Enter

  6. 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!

Gui example.jpg

Share this post


Link to post
Share on other sites



@Chad_C is there a question in there somewhere?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Show script, no picture. A script is extended by a few lines. With picture help willing people must script the GUI.

 

Share this post


Link to post
Share on other sites

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:

  1. 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?
    1. 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.
    2. 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

Share this post


Link to post
Share on other sites

#5 ·  Posted (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:

  1. 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?
    1. 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.
    2. 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 by Kaimberex

Share this post


Link to post
Share on other sites
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?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

 

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

1 person likes this

Share this post


Link to post
Share on other sites

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.

2 people like this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now