Jump to content

Help with a script to generate a simple HTML file


Recommended Posts

My only previous experience with Autoit has been automating installs, pretty much just using winwait and controlclick commands.

Now i'm trying to create a program that would include a gui and allow the user to slect from 3 different templates, then they would imput their personal information, and based on this i would generate an HTML file and use autoit to automatically add the signature file to outlook.

My main issue is i'm still not exactly sure how the gui works, i'm not even 100% sure what type of input to use for having a user input their name, or how to implement this.

if someone could just quickly show me how to:

a) create a new plaintext document

b ) tell the script to generate 1 of x files based on the selection of one radio box and other user input values gotten from ©

c) have a string defined by a user imput box or drop down list

d) have a button inside the gui that when pressed would write lines (i get how to write lines) to the plaintext file then continue running part of the script with a progress bar based on how many steps of the remaining script

while there are tons of examples out there i'm not really native to programming, i'm having a difficult time grasping exactly how this works. I've browsed the forum and help documents quite a bit.

Any and all help is greatly appreciated.

Thanks in advance

EDIT: I just learned to end it i could use do loop, but i'm unsure how i would defeine $msg. Since I need to imput data i was unsure if using $msg = GuiGetMsg() would work. However this doesnt seem like what i would want to do since i want the gui to close at the same time as the action is being taken.

Edited by Swimming_BIrd
Link to comment
Share on other sites

maybe ask for a little help at a time??????

quickly made up this input gui... use save to write to your file

#include <GUIConstants.au3>

GUICreate("My GUI")

$Title_1A = GUICtrlCreateInput("", 20, 60, 90, 20)
$Prog_1A = GUICtrlCreateInput("", 10, 180, 280, 20)
$Pass_1A = GUICtrlCreateInput("", 20, 300, 90, 20)

$Btn_1A = GUICtrlCreatebutton("save", 360, 60, 30, 30)
$Btn_2B = GUICtrlCreateButton("save", 360, 180, 30, 30)
$Btn_3C = GUICtrlCreateButton("save", 360, 300, 30, 30)



GUISetState()

While 1
    
    
    sleep (100)
WEnd

just an idea on direction

8)

NEWHeader1.png

Link to comment
Share on other sites

Thanks!

what exactly in this situation would the save buttons be used for?

And do all of the variables need to be "saved" before they can be used somewhere else in the script?

and i put this much in the threat cuz i may as well centralize it instead of spamming threads, and it often helps to to know what the they are trying to do when you help.

sorry if this was againts forum protocol, i didnt read anything anywhere about this.

Edited by Swimming_BIrd
Link to comment
Share on other sites

No, its not against protocol... i just noticed that the "helpers" here like to "see" your efforts in some sort of "script"

quote "what exactly in this situation would the save buttons be used for?

..."

original quote "...then they would imput their personal information..."

quote"And do all of the variables need to be "saved" before they can be used somewhere else in the script?"

No, they do not have to be saved to a file... but they must be recorded by reading the input... thus pushing the save button could do this

***** it was just a quick suggestion *****

8)

NEWHeader1.png

Link to comment
Share on other sites

Nee to see some effort in form of a "script" from you

#include <GUIConstants.au3>

GUICreate("My GUI")

$Title_1A = GUICtrlCreateInput("", 20, 60, 90, 20)
$Prog_1A = GUICtrlCreateInput("", 10, 180, 280, 20)
$Pass_1A = GUICtrlCreateInput("", 20, 300, 90, 20)


$Btn_3C = GUICtrlCreateButton("save", 360, 300, 30, 30)



GUISetState()

While 1
    
    $Msg = GUIGetMsg
    
    If $Msg = $Btn_3C Then
        $Title = GUICtrlRead($Title_1A); same for other inputs
    ; continue program with the info
        
    EndIf
    
    sleep (100)
WEnd

read the help manual too

8)

NEWHeader1.png

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...