Currently:
NT @CA ATS::
Tech Name: Name Tech ID: ID Tech CBR: 1234567890
*** Remarks: remark go here
___________________
Vnet #: 12345678
CU BTN: 0987654321
CU USI: 123456789012
****************************************
Would Like:
Date: 4/24/18
NT @CA ATS::
Tech Name: Name Tech ID: ID Tech CBR: 1234567890
*** Remarks: remark go here
___________________
Vnet #: 12345678
CU BTN: 0987654321
CU USI: 123456789012
****************************************
Code: Select all
;;;;;;;;;;;;;;;;;;;;;;;;;;HEADER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Name .........: My Notmaker v3.1
; Description ..: A Notmaker that will sent info to a log file and send to clipboard for pasting to notes, ticket etc..
; Language .....: English (en-US)
; Author .......: M R
; Created .....: 4/1/2018
; Filename .....: MYNMv3.1.ahk
;;;;;;;;;;;;;;;;;;;;;;;Changelog;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 4/13/2018 added stopwatch
; working so far
; 4/14/2018 added name of app to title.
; 4/14/2018 changed font size of stopwatch
; 4/22/2018 Added ",%A_MyDocuments%\TESTLOG.txt" to end of fileappend
; 4/24/2018 trying to add a date stamp for each log entry
;
;;;;;;;;;;;;;;;;;StopWatch Special Instructions;;;;;;;;;;;;;;;;;
SetBatchLines, -1
; Some variables
ElapsedTime := A_YYYY ; initialize ElapsedTime, it will be treated as YYYY0101000000
BalanceTime := 0 ; initialize BalanceTime (time not counted yet)
;;;;;;;;;;;;;;;;;;;;;;;;;;Main GUI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Gui, Color, gray ; Color of GUI background
;---------------------------------------------------------------
Gui, font, s14 bold cred
Gui, Add, Text,, Greeting Message Here
Gui, font
;---------------------------------------------------------------
Gui, font, s10 bold
Gui, Add, Text, x6 y74, Tech Name:
Gui, font, s10 norm
Gui, Add, Edit, x92 y70 w230 h25 vone
;---------------------------------------------------------------
Gui, font, s10 bold
Gui, Add, Text, x28 y108, Tech ID:
Gui, font, s10 norm
Gui, Add, Edit, x92 y104 w230 h25 vtwo
;---------------------------------------------------------------
Gui, font, s10 bold
Gui, Add, Text, x13 y142, Tech CBR:
Gui, font, s10 norm
Gui, Add, Edit, x92 y138 w230 h25 vthree
;---------------------------------------------------------------
Gui, font, s10 bold
Gui, Add, Text, x40 y176, Vnet #:
Gui, font, s10 norm
Gui, Add, Edit, x92 y172 w230 h25 vfour
;---------------------------------------------------------------
Gui, font, s10 bold
Gui, Add, Text, x27 y210, CU BTN:
Gui, font, s10 norm
Gui, Add, Edit, x92 y206 w230 h25 vfive
;---------------------------------------------------------------
Gui, font, s10 bold
Gui, Add, Text, x32 y244, CU USI:
Gui, font, s10 norm
Gui, Add, Edit, x92 y240 w230 h25 vsix
;---------------------------------------------------------------
Gui, font, s10 bold
Gui, Add, Text, x22 y278, Remarks:
Gui, font, s10 norm
Gui, Add, Edit, x92 y274 w340 h200 vseven
;---------------------------------------------------------------
Gui, Add, Button, default, SUBMIT ; Submit button will send to clipboard and log file
Gui, Show, w450 h680 ; Size of GUI window
Gui, Show, , My NoteMakr v3.1 ; Name showing in Title of GUI
;;;;;;;;;;;;;;;;;;;;;;;;;StopWatch GUI;;;;;;;;;;;;;;;;;;;;;;;;;;
Gui, Add, Text, ; added line space
Gui, Font, S24 CDefault Bold, Verdana
Gui, Add, Text, x+50 vDisplayTime, 00:00
Gui, Font, S12, Verdana
Gui, Add, Text,
Gui, Add, Button, x+0 yp w80 h30 vBtnStartStop gStartStop Default, Start
Gui, Add, Button, x+2 yp w80 h30 vBtnReset gReset, Reset
;;;;;;;;;;;;;;;;;;;;;;;;;;Author INFO;;;;;;;;;;;;;;;;;;;;;;;;;;;
Gui, font, s10 bold
Gui, Add, Text, x300 y660, Created: by M R ; author note on GUI
Gui, font
Return
;;;;;;;;;;;;;;;;;;;;;;StopWatch FUNCTIONS;;;;;;;;;;;;;;;;;;;;;;;
; BtnStartStop label
StartStop:
GuiControlGet, BtnStartStop ; get the caption of the button
If (BtnStartStop = "Start") { ; if it is "Start"
StartTickCount := A_TickCount - BalanceTime ; initialize StartTickCount
SetTimer, StopWatch, 10 ; start the timer called every 10 ms to be accurate
GuiControl, , BtnStartStop, Stop ; set the caption to Stop
} Else { ; it should be "Stop"
BalanceTime := A_TickCount - StartTickCount ; memorize the balance time not counted yet
SetTimer, StopWatch, Off ; stop the timer
GuiControl, , BtnStartStop, Start ; set the caption to "Start"
}
Return
; BtnReset label
Reset:
SetTimer, StopWatch, Off ; stop the timer
GuiControl, , BtnStartStop, Start ; set the caption of BtnStartStop to "Start"
GuiControl, , DisplayTime, 00:00 ; initialize DisplayTime
ElapsedTime := A_YYYY ; initialize ElapsedTime, it will be treated as YYYY0101000000
BalanceTime := 0 ; initialize BalanceTime
GuiControl, Focus, BtnStartStop ; set the focus on BtnStartStop
GuiControl, -Default, BtnReset ; remove the BS_DEFPUSHBUTTON (default) style
GuiControl, +Default, BtnStartStop ; set the BS_DEFPUSHBUTTON (default) style
Return
; Timer routine
StopWatch:
If ((A_TickCount - StartTickCount) >= 1000) { ; if current tickcount - StartTickCount >= 1000 (i.e. 1 second)
StartTickCount += 1000 ; add 1000 ms (1 second) to StartTickCount
ElapsedTime += 1, S ; add 1 second to ElapsedTime
FormatTime, DisplayTime, %ElapsedTime%, mmm:ss ; format ElapsedTime to mmm:ss
GuiControl, , DisplayTime, %DisplayTime% ; update DisplayTime
}
Return
;;;;;;;;;;;;;;;;;;;;;;;;StopWatch FUNCTIONS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ButtonSUBMIT: ; Submit Button to log file in sam directory of app
Gui, Submit, NoHide
;;;;;;;;;;;;;;;;;;;;;;;;NT Online Notmaker FUNCTIONS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FileCreateDir, %A_MyDocuments%\my-logs ; This will create the folder in my documents folder under the current user login
FileAppend, NT @CA ATS:: `n`nTech Name: %one% Tech ID: %two% Tech CBR: %three%`n`n*** Remarks: %seven%`n`n___________________`n`nVnet #: %four%`nCU BTN: %five%`nCU USI: %six%`n`n****************************************`n`n,%A_MyDocuments%\my-logs\mynotelog.txt ; ",%A_MyDocuments%\ntcalllog\ntcalls.txt" is the file location after the folder is created.
clipboard = NT @CA ATS:: `n`nTech Name: %one% Tech ID: %two% Tech CBR: %three%`n`n*** Remarks: %seven%`n`n___________________`n`nVnet #: %four%`nCU BTN: %five%`nCU USI: %six%`n`n****************************************`n`n
Loop, 7
GuiControl,,Edit%A_index%,
Return
^SPACE:: Winset, Alwaysontop, , A
GuiClose: ; Will close app out
ExitApp