Skip to content

Instantly share code, notes, and snippets.

@JoeGlines
Created May 27, 2021 23:07
Show Gist options
  • Save JoeGlines/005b713424288554e336ba67079a7775 to your computer and use it in GitHub Desktop.
Save JoeGlines/005b713424288554e336ba67079a7775 to your computer and use it in GitHub Desktop.
Example showing how easy it is to add a GUI
;*******************************************************
; Want a clear path for learning AutoHotkey; Take a look at our AutoHotkey Udemy courses. They're structured in a way to make learning AHK EASY
; Right now you can get a coupon code for GUIs are Easy here: https://www.the-automator.com/learn-autohotkey/guis-are-easy-with-autohotkey/
;*******************************************************
#SingleInstance, force
Gui, main:new
Gui, add, text,w50, Rows
Gui, add, edit, w50 x+10 vedRow
Gui, add, text,w50 xm, Columns
Gui, add, edit, w50 x+10 vedCol
; Gui, add, text, 0x10 w250 xm
Gui, add, button, w75 xm-1 gCreate, % "Create Table"
Gui, show
return
;********************Create HTML function***********************************
Create(CtrlHwnd, GuiEvent, EventInfo, ErrLevel:=""){
GuiControlGet, edRow ;Get Row data from GUI
GuiControlGet, edCol ;Get Column data from GUI
;**************************************
ColCount:=edCol ;Push into origial variable
RowCount:=edRow ;Push into original Row count variable
;********************build columns***********************************
Row:="<tr>" ;Begin row with Table Row tag
Loop, % ColCount
row.=" <td></td> " ;Add columns
row.="</tr>`n" ;End Table Row tag and add new line
;********************Now take care of rows***********************************
loop, % RowCount
rows.=row ;Simply create multiple rows
;********************Clear out variables and push to clipboard***********************************
MsgBox % Clipboard:="<table>`n" rows "</table>"
row:=rows:="" ;Clear variables
return
}
;********************To easily exit the program, either hit escape or close the GUI***********************************
mainGuiEscape:
mainGuiClose:
ExitApp
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment