From c9fced6b6de33445cdebf9c46b880413b393ef73 Mon Sep 17 00:00:00 2001 From: David Daily Date: Thu, 23 Jan 2020 05:34:20 -0600 Subject: [PATCH] Add support for updating the dealer information wrote a new function for this, check func.ahk: https://daviddaily.dev/david/d3k/commit/f6d0981b3b1bab09a187840fae0b7a17b540bac6 --- D3K.ahk | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/D3K.ahk b/D3K.ahk index 49577d4..fa75521 100644 --- a/D3K.ahk +++ b/D3K.ahk @@ -132,8 +132,8 @@ If (glovar = 1) } If InStr(REKey, "xid") ; If an xID is entered. Unique identifier for people { - dealinfo := GetInfo(REValue) ; Gets information, see function for details StringUpper, REValue, REValue ; Makes xID uppercase + dealinfo := GetInfo(REValue) ; Gets information, see function for details if !(REValue = dealinfo.xid) { @@ -152,17 +152,15 @@ If (glovar = 1) FileCopy, tempglovar, glovar.ahk,1 FileDelete, tempglovar - WinWaitNotActive, GloVar.ini - { - ini_writeValue(glovarini, "xID", REValue) ; Writes the xID entered, but uppercase - ini_writeValue(glovarini, "dem", dealinfo.email) ; Writes email address (incredibly useful) - ini_writeValue(glovarini, "dnm", dealinfo.name) ; Writes Name (useful for when referring to that person) - ini_writeValue(glovarini, "dus", dealinfo.user) ; Writes demo account name (somewhat useful) - } + ini_writeValue(glovarini, "xID", REValue) ; Writes the xID entered, but uppercase + ini_writeValue(glovarini, "dem", dealinfo.email) ; Writes email address (incredibly useful) + ini_writeValue(glovarini, "dnm", dealinfo.name) ; Writes Name (useful for when referring to that person) + ini_writeValue(glovarini, "dus", dealinfo.user) ; Writes demo account name (somewhat useful) + FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code Continue } - If (InStr(REKey, "dem") or InStr(REKey, "dnm") or InStr(REKey, "dus")) + If (InStr(REKey, "dem") or InStr(REKey, "dnm") or InStr(REKey, "dus") or InStr(REKey, "dorg")) { ; Do not process xID related info, that is done above Continue @@ -193,6 +191,20 @@ If (glovar = 1) } Break } + If InStr(RESection, "up") + { + new_email := ini_getValue(%glovarini%, "up", "dem") + new_name := ini_getValue(%glovarini%, "up", "dnm") + new_user := ini_getValue(%glovarini%, "up", "dus") + new_org := ini_getValue(%glovarini%, "up", "dorg") + xID := ini_getValue(%glovarini%, "up", "xID") + + StringUpper, new_user, new_user + SetInfo(xID, "email", new_email) + SetInfo(xID, "name", new_name) + SetInfo(xID, "user", new_user) + SetInfo(xID, "org", new_org) + } } } FileGetTime, gvMod, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code @@ -616,18 +628,21 @@ SetTitleMatchMode, 2 ;------------------------------------------------------------------------------ #j:: -Run, C:\Users\%racf%\Downloads ; Open the downloads folder on Win+J + Run, C:\Users\%racf%\Downloads ; Open the downloads folder on Win+J Return #w:: -if WinActive("ahk_exe Explorer.EXE") ; If windows explorer is focused -{ - Send !d ; Focus the address bar - Send C:\Users\%racf%\Documents\Work_Docs\Cases\2020-01 - 06 ; current folder, would love to use a var instead, but Run doesn't like it - Send {Enter} - Return -} -Run, C:\Users\%racf%\Documents\Work_Docs\Cases\2020-01 - 06 ; Open the documentation folder on Win+W + if WinActive("ahk_exe Explorer.EXE") ; If windows explorer is focused + { + Send !d ; Focus the address bar + Send %A_MyDocuments%\Work_Docs\Cases\2020-01 - 06 ; current folder + Send {Enter} + Return + } + else + { + Run, %A_MyDocuments%\Work_Docs\Cases\2020-01 - 06 ; Open the documentation folder on Win+W + } Return \ No newline at end of file