[Help]Small Project

Get help with using AutoHotkey and its commands and hotkeys
Mightykiller
Posts: 43
Joined: 09 Oct 2017, 13:34

[Help]Small Project

20 Oct 2017, 16:47

Hi, I am working on a project i am new in Autohotkey Programming.
So my project is about storing names i type in a box and showing them in a list.
So for example i have 2 boxes
First box is for storing names.
And a list to show all names added.
Second box is for the string i want before every name.
And a button to send the names 1 by 1 with the string before every name.
Lets say i typed in the first box : "Mark" "Kavin" "Roger"
And in the second box i typed "Hello "
i would get:
Hello Mark
Hello Kavin
Hello Roger

i just need some help to start ;)
SirRFI
Posts: 404
Joined: 25 Nov 2015, 16:52

Re: [Help]Small Project

20 Oct 2017, 17:27

Check out GUI. You'll want to Add two Edit controls and a Button. Each of them should have vControlName that You can refer to after Submit or with GuiControlGet. Lastly, You'll want to StrSplit (use StrSplit()) the name list, and for-loop each array element add the thing from second box beforehands when displaying.
Use [code=autohotkey] forum tag to share your code.
Click on (Accept this answer) on top-right part of the post if it has answered your question / solved your problem.
BarbiesScripts

Re: [Help]Small Project

20 Oct 2017, 17:29

Most of the code I took from sjc1000 https://autohotkey.com/board/topic/8481 ... t-boxloop/

Gui, Add, Edit, w200 h200 vEdit
Gui, Add, Edit, w200 h20 vEditt
Gui, Add, Button, w100, OK
Gui, Show
return


ButtonOK:
Gui, Submit, NoHide
Loop, Parse, Edit, `n
{
Line%A_Index% = %A_LoopField% ; Put it into Line%A_Index% ( Line1, Line2, Line3, Line4 etc.)
MsgBox, % Editt " " Line%A_Index%
}
Return
Mightykiller
Posts: 43
Joined: 09 Oct 2017, 13:34

Re: [Help]Small Project

21 Oct 2017, 12:58

Ok so i made this
but its not working...
I need to add something to add the names from vVouch to the ListBox using the Add to list button
And if i press Vouch button i want the project to sendinput a string + name + vReason
And what should i add if i wanted it to sendinput to another running software

Code: Select all

Gui +Resize
Gui Add, Tab3, x0 y0 w600 h400, Vouch|Ban
Gui Tab, 1
Gui Add, Text, x45 y76 w40 h23 +0x200, Reason:
Gui Add, Edit, x88 y79 w120 h21 vVouch
Gui Add, Button, x281 y52 w80 h23, &Add to list
Gui Add, Button, x124 y117 w80 h23, &Vouch all users
Gui Add, Button, x219 y52 w55 h23, Vouch
Gui Add, ListBox, x49 y191 w121 h251
Gui Add, Edit, x88 y52 w120 h21 vReason
Gui Add, Text, x20 y50 w66 h23 +0x200, Display name:
Gui Add, Text, x33 y119 w57 h23 +0x200, List of users



Gui Show, w600 h400, Project
Return


ButtonVouch:
Gui, Submit, NoHide
Loop, Parse, vVouch, `n
{
Line%A_Index% = %A_LoopField% ; Put it into Line%A_Index% ( Line1, Line2, Line3, Line4 etc.)
MsgBox, % vReason " " Line%A_Index%
}
Return



GuiSize:
    If (A_EventInfo == 1) {
        Return
    }

Return

GuiEscape:
GuiClose:
    ExitApp
Mightykiller
Posts: 43
Joined: 09 Oct 2017, 13:34

Re: [Help]Small Project

21 Oct 2017, 13:06

This is the preview of my project.
prev.png
prev.png (19.47 KiB) Viewed 248 times
User avatar
jeeswg
Posts: 5146
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [Help]Small Project

21 Oct 2017, 13:36

In Gui commands, specify vVouch to create variable Vouch, and vvVouch to create variable vVouch.

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], tmplinshi and 57 guests