initial commit

This commit is contained in:
David Daily 2019-12-17 10:57:15 -06:00
parent 7a3e2653ad
commit f5721662f1
5 changed files with 950 additions and 0 deletions

172
Case_Formatter.ahk Normal file
View File

@ -0,0 +1,172 @@
#Include, func.ahk
SetTitleMatchMode, 2
ini = %A_MyDocuments%\D3Ksettings.ini
; These next 3 options make it so that it's always on top, it there are no buttons, and doesn't show up in the alt-tab or taskbar
Gui,+AlwaysOnTop
Gui, +ToolWindow
IniRead, docfile, %ini%, USpec, DocFile, 0
CurrTimeEN := GetDateTime("en")
CurrTimeDE := GetDateTime("de")
;------------------------------------------------------------------------------
; GUI creation
;------------------------------------------------------------------------------
; The & in front of the letters lets you hold alt and press the first letter instead of having to click on it. That is why its "Mail", not "E-Mail"
Gui, Add, Text, x75 y46 w150 h20 gTime, %CurrTimeEN%
Gui, Add, Radio, x12 y3 w60 h20 Group vLang Checked, &English ; First group of Radio buttons
Gui, Add, Radio, x12 y23 w60 h20, &German
Gui, Add, Radio, x82 y3 w60 h20 Group vContact Checked, E-&Mail ; Second group of Radio buttons
Gui, Add, Radio, x82 y23 w60 h20, &Call
Gui, Add, Radio, x142 y3 w80 h20 Group vAct, &Warrant
Gui, Add, Radio, x142 y23 w80 h20 , &Demo
Gui, Add, Button, x12 y43 w55 h20 Default vHidden, Go ; That way you don't have to have an actual button, it just happens when you press enter.
Gui, Show, h70 w210, Contact
;GuiControl, Hide, Hidden ; Hide the button to be hidden
Return
Time:
Run, addemail.ahk
GuiClose:
GuiEscape:
ExitApp
;------------------------------------------------------------------------------
; Buttons
;------------------------------------------------------------------------------
ButtonGo:
Gui, submit
Goto, Write
Return
/*
Contact
Mail: 1
Call: 2
Lang
English: 1
German: 2
Act
Warrant: 1
Demo: 2
*/
Write:
{
FileRead, NewLine, %docfile% ; Read the documentation file
If (NewLine != "") ; If there is something in the file, this would return a string
{
FileAppend,`n`n`n`n, %docfile% ; Inserts a new line so that it isn't just appended directly to the end
}
NewLine := "" ; Free up Memory cause this could be quite a bit of stuff
;------------------------------------------------------------------------------
; Email
;------------------------------------------------------------------------------
If (Contact = "1")
{
If (Lang = "1") ; English
{
If (Act = "0") ; Not an activation
{
FileAppend,Dealer emailed: "", %docfile%
}
If (Act = "1") ; Warrant
{
FileAppend,Dealer emailed for warrant transfer: ""`n`nOld SN: `nNew SN: `nChallenge Code: `n`n, %docfile%
}
If (Act = "2") ; Demo
{
FileAppend,Dealer emailed for `n`nSN: `nChallenge Code: `n`n, %docfile%
}
}
Else If (Lang = "2") ; German
{
If (Act = "0") ; Not an activation
{
FileAppend,Händler emailte: "", %docfile%
}
Else If (Act = "1") ; Warrant
{
FileAppend,Händler emailte für Garantieübertragung`n`nAlte SN: `nNeue SN: `nAuthentisierungscode: `n`n, %docfile%
}
Else If (Act = "2") ; Demo
{
FileAppend,Händler emailte für `n`nSN: `nAuthentisierungscode: `n`n, %docfile%
}
}
}
;------------------------------------------------------------------------------
; Call
;------------------------------------------------------------------------------
Else If (Contact = "2")
{
If (Lang = "1") ; English
{
FileAppend, Call received %CurrTimeEN%.`n`n, %docfile%
If (Act = "0") ; Not an activation
{
FileAppend,Dealer called for, %docfile%
}
Else If (Act = "1") ; Warrant
{
FileAppend,Dealer called for Warrant transfer`nOld SN: `nNew SN: `nChallenge Code: `n`n, %docfile%
}
Else If (Act = "2") ; Demo
{
FileAppend,Dealer called for Demo`nSN: `nChallenge Code: `n`n, %docfile%
}
}
Else If (Lang = "2") ; German
{
FileAppend, Anruf wurde %CurrTimeDE% entgegengenommen.`n`n, %docfile%
If (Act = "0") ; Not an activation
{
FileAppend,Händler rief an mit, %docfile%
}
Else If (Act = "1") ; Warrant
{
FileAppend,Händler rief an für Garantieübertragung`nAlte SN: `nNeue SN: `nAuthentisierungscode: `n`n, %docfile%
}
Else If (Act = "2") ; Demo
{
FileAppend,Händler rief an für Demo`nSN: `nAuthentisierungscode: `n`n, %docfile%
}
}
}
WinActivate, docfile.txt ; Switch to the txt file where the notes are being taken
ExitApp
}

627
D3K.ahk Normal file
View File

@ -0,0 +1,627 @@
#Include, func.ahk
lastFileContent =
Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard
SetWorkingDir, %A_MyDocuments%\D3K ; Make sure we can find the .ahks linked below
ini = %A_MyDocuments%\D3Ksettings.ini ; Where the settings ini is
;------------------------------------------------------------------------------
; Make sure the settings file exists, if not, create it
;------------------------------------------------------------------------------
If !FileExist(ini) ; Check if the ini doesn't exist
{
FileAppend,
(
; 0 is off, 1 is on
[USpec]
RACF=LF01234
Email=LastnameFirstname@JohnDeere.com
DocFile=Select File
[Main]
Mansol=1
Supadmin=1
MJDPaste=1
CaseFormatter=1
[Replacement]
Symbols=1
JDProductNames=1
GloVar=0
[Language]
German=0
[Info]
Version=0
), %ini%
Run Settings.ahk ; Runs the GUI for changing the settings, also accessible with Alt+Shift+\ (also easy way to restart this script)
}
;------------------------------------------------------------------------------
; Read the ini
;------------------------------------------------------------------------------
; This is the part that reads the file to see what your settings are. Variables in the ini file are in all lowercase, variables here are CamelCase for more distinction
; User Specific things:
racf := ini_getValue(ini, "USpec", "RACF")
email := ini_getValue(ini, "USpec", "Email")
docfile := ini_getValue(ini, "USpec", "DocFile")
; General Settings
mansol := ini_getValue(ini, "Main", "Mansol")
supadmin := ini_getValue(ini, "Main", "Supadmin")
mjdpaste := ini_getValue(ini, "Main", "MJDPaste")
caseformatter := ini_getValue(ini, "Main", "CaseFormatter")
; Replacement
symb := ini_getValue(ini, "Replacement", "Symbols")
jdpn := ini_getValue(ini, "Replacement", "JDProductNames")
glovar := ini_getValue(ini, "Replacement", "GloVar")
; Language
ger := ini_getValue(ini, "Language", "German")
amse := ini_getValue(ini, "Language", "AMSE")
;------------------------------------------------------------------------------
; Global Variables
;------------------------------------------------------------------------------
If (glovar = 1)
{
glovarini = %A_MyDocuments%\GloVar.ini ; Location of the ini that the user modifies
SetTimer, GloVar, 2000 ; Check every 2 seconds
GloVar:
WinWaitNotActive, GloVar.ini ; So that we don't get any problems with the file on disk being out of date. I use VSCode with the "Save on lose focus" option on, YMMV
{
fileread, newFileContent, %glovarini%
if !(newFileContent = lastFileContent) ; Those two lines mean the rest of this only executes if there were changes to the ini.
{
lastFileContent := newFileContent
FileDelete, glovar.ahk ; Start with a clean slate
FileAppend, #SingleInstance force`n`n, glovar.ahk ; makes sure we only have one instance of the script running at a time
RESection := "" ; Make sure that its clear
Loop, Read, %glovarini% ; Read one line at a time
{
RegExMatch(A_LoopReadLine, "(?<=\[).*(?=\])", RESection) ; explained above
RegExMatch(A_LoopReadLine, "^(?<Key>.*)=(?<Value>.*)", RE) ; Key = REKey, Value = REValue
If !(RESection) ; If the RegEx doesn't find antything, its empty
{
If !(REValue) ; If there is no value for the key, skip it (Continue the loop at the next line)
{
Continue
}
If InStr(StoredSection, "Serial Numbers") ; If the section is "Serial Numbers", make everything uppercase
{
StringUpper, REValue, REValue ; Makes it uppercase
WinWaitNotActive, GloVar.ini ; Just to make sure
{
ini_writeValue(glovarini, REKey, REValue)
fileread, lastFileContent, %glovarini%
}
}
If InStr(StoredSection, "Operations Center") ; If the section is "Operations Center" and the Key "un", make it uppercase
{
If InStr(REKey, "usr")
{
StringUpper, REValue, REValue ; Makes it uppercase
WinWaitNotActive, GloVar.ini
{
ini_writeValue(glovarini, REKey, REValue) ; Writes the properly formatted case number to glovar.ini
fileread, lastFileContent, %glovarini%
}
}
}
If InStr(REKey, "case") ; If a key contains "case". Case numbers are all in the format "LETTERS-NUMBERS".
{
StringUpper, REValue, REValue ; Makes it uppercase
RegExMatch(REValue, "(?<=\().*(?=\))", REMatch) ; Match everything but the parenthesis. When the case numbers are shown they have parenthesis, and those are annoying.
If (REMatch) ; If there's anything there
{
WinWaitNotActive, GloVar.ini
{
ini_writeValue(glovarini, REKey, REMatch) ; Writes the properly formatted case number to glovar.ini
fileread, lastFileContent, %glovarini%
}
REValue := REMatch
} Else {
WinWaitNotActive, GloVar.ini
{
ini_writeValue(glovarini, REKey, REValue) ; Writes the properly formatted case number to glovar.ini
fileread, lastFileContent, %glovarini%
}
}
}
writethis := ":*:$" REKey "::" REValue "`n" ; Save the hotstring to a variable
FileAppend, %writethis%, glovar.ahk ; Write the variable to glovar.ahk
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
WinWaitNotActive, GloVar.ini
{
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
}
If FileExist("glovar.ahk")
{
Run glovar.ahk
}
Goto, GloVar
}
fileread, lastFileContent, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code
}
If (RESection) ; If we have a secion
{
StoredSection := RESection
If InStr(RESection, "clear") ; Will clear the ini and save its and the documentation file's contents to a log
{
FileRead, doctemp, %docfile% ; Read documentation file, set in settings
FileRead, initemp, %glovarini% ; Read the ini
initemp := RegExReplace(initemp, "(?<=\[)clear(?=\])", "Info") ; Replace the "clear" section we set with Info
CurrTime := GetDateTime("en") ; get the current date and time as "YYYY-MM-DD at HH:MM GMT"
writethis := "Case on " . CurrTime . "`n" . doctemp . "`n`n" . initemp ; Save the current time, what was in the doc file, and glovarini to a variable
FileAppend, % "`n`n`n`n" writethis "`n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", %A_MyDocuments%/D3KLog.txt ; Write a few new lines , the content, and a line underneath
FileCopy, glovarsource, %glovarini%, 1 ; Copies and replaces any text in glovar.ini with the template
fileread, lastFileContent, %glovarini% ; Make sure that this script knows what the ini was changed to so it doesn't constantly run through the above code
FileDelete, glovar.ahk ; A CLEAN SLATE
FileAppend, #SingleInstance force`n`n, glovar.ahk
Sleep, 500
Run glovar.ahk
Break ; Makes sure we're done with this loop and go to the right place
}
}
If FileExist("glovar.ahk")
{
Run glovar.ahk
}
}
Return
}
}
Return
}
;------------------------------------------------------------------------------
; Settings window
;------------------------------------------------------------------------------
!+\::Run Settings.ahk ; Alt+Shift+\
;------------------------------------------------------------------------------
; DTAC Solution Opener
;------------------------------------------------------------------------------
#If, mansol = "1" ; checks from the variable thats set from the .ini file
!+S::Run Mansol_Opener.ahk ; Alt+Shift+S
#If ; these are to make sure one "if" doesn't influence the next accidentially
;------------------------------------------------------------------------------
; Case Formatter
;------------------------------------------------------------------------------
#If, CaseFormatter = "1"
Pause::Run Case_Formatter.ahk ; The Pause|Break key
#If
; These things below are for using in a pinch, or when there is no dealer.
SetTitleMatchMode, 2
#If (WinActive = Temp.txt) && (CaseFormatter = "1")
:*:\case::
CurrTime := GetDateTime("en")
Send Call received on %CurrTime% {Enter}Name: {Enter}Username: {Enter}
Return
#If
;German
#If (CaseFormatter = "1") && (ger = "1")
:*:|case::
CurrTime := GetDateTime("de")
Send Anruf wurde am %CurrTime% entgegengenommen{Enter}Name: {Enter}Benutzername: {Enter}
Return
#If
;-------------------------------------------------------------------------------
; Special Characters
;-------------------------------------------------------------------------------
#If, ger = "1"
; scharfes s / Eszett / ß
!s::Send {U+00DF} ;Alt+S
; ä
!a::Send {U+00E4} ;Alt+a
; ö
!o::Send {U+00F6} ;Alt+o
; ü
!u::Send {U+00FC} ;Alt+u
; Ä
+!A::Send {U+00C4} ;Alt+A
; Ö
+!O::Send {U+00D6} ;Alt+O
; Ü
+!U::Send {U+00DC} ;Alt+U
#If
;-------------------------------------------------------------------------------
; Capitalise dates
;-------------------------------------------------------------------------------
::monday::Monday
::tuesday::Tuesday
::wednesday::Wednesday
::thursday::Thursday
::friday::Friday
::saturday::Saturday
::sunday::Sunday
::january::January
::february::February
; ::march::March ; Commented out because it matches the common word "march".
::april::April
; ::may::May ; Commented out because it matches the common word "may".
::june::June
::july::July
::august::August
::september::September
::october::October
::november::November
::december::December
; German
#If, ger = "1"
::montag::Montag
::dienstag::Dienstag
::mittwoch::Mittwoch
::donnerstag::Donnerstag
::freitag:: Freitag
::samstag::Samstag
::sonntag::Sonntag
::januar::Januar
::februar::Februar
::märz::März
::mai::Mai
::juni::Juni
::juli::Juli
::oktober::Oktober
::dezebmer::Dezember
#If
;------------------------------------------------------------------------------
; Copypastas
;------------------------------------------------------------------------------
; Recommending case
:*:]rec::
Send Recommending Case, please contact us if there are any further questions.
Return
; Escalatimg Case
:*:]esc1::
Send This case was unable to be resolved and has been transferred to another team. Our Tier 2 team is investigating the issue to find a short term resolution. We will update you as soon as we have a recommendation.
Return
:*:]esc2::
Send A short term resolution still has not been identified. We are requesting an immediate update on this case from our Tier 2 team. We will contact you as soon as we have a status update.
Return
; Requesting info
:*:]req1::
Send A request has been made for additional information in this case. Please provide the information as soon as possible so that the case can be resolved.
Return
:*:]req2::
Send A follow-up request has been made for the additional information.
Return
:*:]req3::
Send The additional information required has not yet been received. This case will now be sent back to you. Please reopen the case, or contact the Global Support Center again via phone or email with the additional information and reference this case number so that it can be reopened and investigated further.
Return
; Defect / NCCA
:*:]ncca::
Send We will be recommending this case back to you for the time being. This issue is still being investigated and worked on via an internal product corrective action ticket. We will continue to monitor the progress of that ticket and contact you when we have a solution or a short term recommendation. The case text will be updated at that time for documentation purposes.{Enter}You may choose to close this case yourself, return it to us, or keep it open until we provide you with a corrective action recommendation. If you have questions on the status of this issue, please re-open the case or contact the Global Support Center using the contact information found in DTAC solution 82793. We will provide you with any information we are able to gather from the product team.
Return
; DTAC
:*:]dtac::
Send The ISG Global Support Center has determined that this case is hardware related; therefore this case is being transferred from the GSC to the ISG DTAC group. A DTAC technician will now work this case via the CCMS system and provide a recommendation in the case text if more information is needed or if a solution has been found. Please continue to update or check on the progress of this case by using the CCMS system case text section moving forward.
Return
; German
#If, ger = "1"
; Recommending Case
:*:[rec::
Send Fall an H{U+00E4}ndler gewiesen, bitte melden Sie sich wenn sie weitere fragen haben.
Return
; Escalating Case
:*:[esc1::
Send Der Fall konnte vom GSC nicht gelöst werden und wurde an die nächste Supportebene weitergeleitet. Das Support Team wird das Problem weiter untersuchen und versuchen eine kurzfristige Lösung bereit zu stellen. Sobald wir eine Empfehlung erhalten, werden wir Sie darüber informieren.
Return
:*:[esc2::
Send Bisher steht uns keine kurzfristige Lösung zur Verfügung. Wir fordern umgehend ein Status-Update bezüglich des Falls von unserem Support Team an.{Shift down}{Enter}{Shift up}Wir werden Sie erneut kontaktieren, sobald wir über den aktuellsten Stand des Falls informiert sind.
Return
; Requesting info
:*:[req1::
Send Wir haben zusätzliche Informationen von Ihnen bezüglich des Falls angefordert. Bitte stellen Sie uns die Informationen so bald wie möglich zur Verfügung, damit der Fall gelöst werden kann.
Return
:*:[req2::
Send Wir fordern die zusätzlichen Informationen von Ihnen erneut an.
Return
:*:[req3::
Send Wir haben die benötigten zusätzlichen Informationen von Ihnen noch nicht erhalten. Dieser Fall wird jetzt zu Ihnen zurückgeschickt. Bitte setzen Sie sich mit dem GSC telefonisch oder per Email mit den zusätzlichen Informationen nochmal in Verbindung und referenzieren Sie die Fallnummer, damit der Fall erneut geöffnet und weiter untersucht werden kann.
Return
; Defect / NCCA
:*:[ncca::
Send Wir werden diesen Fall vorübergehend an Sie zurückweisen. Dieses Problem wird noch über ein innenseitiges Produkt Korrektur Ticket bearbeitet. Wir werden weiterhin den Fortschritt dieses Tickets verfolgen und mit Ihnen Kontakt aufnehmen, wenn wir eine Lösung oder eine kurzfristige Empfehlung haben.{Enter}Sie können diesen Fall selbst schließen, an uns zurückzugeben oder offen halten, bis wir Ihnen eine Korrekturmaßnahme empfehlen. Wenn Sie Fragen zum Fall Status haben wenden Sie sich an das Global Support Center, indem Sie die Kontaktinformationen in der DTAC-Lösung 82793 abrufen. Wir werden Ihnen alle Informationen, die wir von dem Produktteam bekommen haben, zu Verfügung stellen.
Return
; DTAC
:*:[dtac::
Send Das ISG Global Support Center hat festgestellt, dass dieser Fall hardwarebezogen ist; Daher wird dieser Fall vom GSC an die ISG DTAC Gruppe übertragen. Ein DTAC-Techniker wird nun diesen Fall über das DTAC-System bearbeiten und eine Empfehlung im Fall Text geben, wenn weitere Informationen benötigt werden oder wenn eine Lösung gefunden wurde. Dementsprechend bitten wir Sie, den Fortschritt des Falls mithilfe des Falltextes zu überprüfen und falls nötig mit fehlenden Informationen zu ergänzen.
Return
#If
;------------------------------------------------------------------------------
; Email
;------------------------------------------------------------------------------
; Regular
:*:]email::
Send Hello,{Enter 2} {Shift down}{Enter}{Shift up}Please contact us if you have any questions.{Up}{End}
Return
; DTAC Problem
:*:]97010::
Send Hello,{Enter 2} As this is a hardware/compatibility related inquiry, we here at the GSC cannot assist you properly. Please contact DTAC and they will be able to assist you further.
Return
; 2 Year old COMAR
:*:]2yc::
Send Hello,{Enter 2} You are unable to activate this product as the COMAR is over 2 years old. There is a form in the Dealer Corner that you can fill out to have it replaced as long as it falls within the criteria outlined in solution 108357.{Enter}Please contact your TCSM if you have any questions about this process.
Return
; CCMS
:*:]cms::
Send Hello,{Enter 2} {Enter}{Home down}{Shift up}{Home up}Please contact us if you have any questions.{Enter 2}Thank you,{Enter}David{Up 4}{End}
Return
#If
; German
#If, ger = "1"
; Regular
:*:[email::
Send Hallo,{Enter 2} {Shift down}{Enter}{Shift up}Für Rückfragen stehen wir gerne zur Verfügung.{Up}{End}
Return
; DTAC Problem
:*:[97010::
Send Hallo,{Enter 2} Da dies eine Hardware/Kompatibilität-bezogene Anfrage ist, können wir hier im GSC leider ihre Frage nicht sehr gut beantworten. Bitte wenden Sie sich an DTAC, dort können Sie bessere unterstützung für diesen typ von fragen bekommen.
Return
; 2 Year old COMAR
:*:[2yc::
Send Hallo,{Enter 2} Sie können dieses Produkt nicht aktivieren weil die COMAR-Nummer über 2 Yahre alt ist. Es gibt in Vertriebspartnerinformation ein Formular das Sie ausfüllen können, und Ihre Aktivierungen werden ersetzt so lange es innerhalb der Regeln in DTAC Lösung 108357 ist.{Enter}Bitte melden Sie sich bei Ihrem Technischen Bezirksleiter wenn Sie Fragen über diesen Prozess haben.
Return
; CCMS case
:*:[cms::
Send Hallo,{Enter 2} {Enter}{Home down}{Shift up}{Home up}Für Rückfragen stehen wir gerne zur Verfügung.{Enter 2}Mit freundlichen Grüßen,{Enter}David{Up 4}{End}
Return
#If
;------------------------------------------------------------------------------
; Profile email paste
;------------------------------------------------------------------------------
; So when editing Profiles, it won't let you paste in the email field. We don't like that. Make sure to let go of all keys immediatley after pressing this
#If, mjdpaste = "1"
#v::
sleep, 750
Send %clipboard%
sleep, 500
send # ; to make sure the start menu isn't open for some reason
return
#If
;------------------------------------------------------------------------------
; Common Terms autocorrect and replacement
;------------------------------------------------------------------------------
; Symbols, these only replaced when an end character is typed afterwards
#If, symb = "1"
::(deg)::{ASC 248}
::(eq)::{ASC 247}
#If
#If, not(racf = "LF01234") ; So that it doesn't put the fake RACF from the default ini file
:*:]me::
Send, %racf%
return
:*:[me::
Send, %racf%
return
#If
#If, not(email = "LastnameFirstname@JohnDeere.com") ; Same as above
:*:@me::
Send, %email%
Return
#If
; R2 Shared Inbox
#If, ger = "1"
:*:@amse::
Send, %amse%
Return
#If
; JD Names
#If, jdpn = "1"
:*:[xx::XXXXXXXXXXXXX ; I'm not gonna try and find the right amount of X's to appease the CCMS demons
:*:]xx::XXXXXXXXXXXXX
; English
:*:]at::AutoTrac
:*:]sf::StarFire
:*:]jdlw::JDLink Web
:*:]jdld::JDLink Dashboard
:*:]jdl2::JDLink Dashboard 2.0
:*:]jdlc::JDLink Connect
:*:]jdla::JDLink Access
:*:]jdls::JDLink Subscription
:*:]jdll::JDLink
:*:]jdp::JDParts
:*:]mjd::MyJohnDeere
:*:]opsc::Operations Center
:*:]seccon::Section Control
:*:]gs::GreenStar
:*:]cc::CommandCenter
:*:]fc::Field Connect
:*:]rs::RowSense
:*:]sub::subscription
:*:]ss::Stellar Support
:*:]tman::Technical Manual
:*:]operm::Operator's Manual
:*:]hl3::HarvestLab 3000
:*:]hlo::Original HarvestLab
:*:]bin::Virtual Inventory
:*:]warrep::Warranty Reports
:*:]tp::TouchPoint
:*:]tcsm::Territory Customer Support Manager
:*:]macrep::Machine Reports
:*:]jdsm::John Deere Software Manager
:*:]jddm::John Deere Data Manager
:*:]serva::Service Advisor
:*:]muc::Master Unlock Code
::rowsense::RowSense
::comar::COMAR
::mrtk::mRTK
::rda::RDA
::rtk::RTK
::autotrac::AutoTrac
::ccms::CCMS
::dtac::DTAC
::tcsm::TCSM
::itec::iTEC Pro
::ssu::SSU
::atu::ATU
:*:mtg::MTG
::wdt::WDT
::itc::iTC
::vin::VIN
::gs2::GS2
::gs3::GS3
::sf1::SF1
::sf2::SF2
::sf3::SF3
::sf4::SF4
::xid::xID
::pmcalc::PMCalc
::vat::VAT
; German
#If, ger = "1"
:*:[at::AutoTrac
:*:[sf::StarFire
:*:[jdlw::JDLink Web
:*:[jdld::JDLink Dashboard
:*:[jdl2::JDLink Dashboard 2.0
:*:[jdlc::JDLink Connect
:*:[jdla::JDLink Access
:*:[jdls::JDLink Abonnement
:*:[jdll::JDLink
:*:[jdp::JDParts
:*:[mjd::MyJohnDeere
:*:[opsc::Einsatzzentrale
:*:[seccon::Teilbreitensteuerung
:*:[gs::GreenStar
:*:[cc::CommandCenter
:*:[fc::Field Connect
:*:[rs::RowSense
:*:[sub::Abonnement
:*:[ss::Stellar Support
:*:[tman::Technische Betriebsanleitung
:*:[oman::Betriebsanleitung
:*:[hl3::HarvestLab 3000
:*:[hlo::Originales HarvestLab
:*:[bin::Virtuellen Bestand
:*:[warrep::Warranty Reports
:*:[tp::TouchPoint
:*:[tcsm::Technischer Bezirksleiter
:*:[macrep::Machine Reports
:*:[jdsm::John Deere Software Manager
:*:[jddm::John Deere Data Manager
:*:[serva::Service Advisor
:*:[muc::Master Unlock Code
#If
;------------------------------------------------------------------------------
; QoL Improvements
;------------------------------------------------------------------------------
#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\2019-07 - 12 ; 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\2019-07 - 12 ; Open the documentation folder on Win+W
Return

39
addemail.ahk Normal file
View File

@ -0,0 +1,39 @@
#Include, func.ahk
Menu, Tray, Icon, shell32.dll, 283 ; Set the tray icon to a keyboard
SetWorkingDir, %A_MyDocuments%\D3K ; Make sure we can find the .ahks linked below
csv = %A_MyDocuments%\Work_Docs\emails.csv ; Where the email CSV is
Gui, +AlwaysOnTop +ToolWindow
Gui, Add, Text, x2 y2 w60 h17 +Center, xID
Gui, Add, Text, x65 y2 w120 h17 +Center, Name
Gui, Add, Text, x190 y2 w100 h17 +Center, Email
Gui, Add, Edit, x2 y17 w60 h20 vXid
Gui, Add, Edit, x65 y17 w120 h20 vName
Gui, Add, Edit, x190 y17 w100 h20 vEmail
Gui, Add, Button, x172 y89 w70 h30 Default, OK
Gui, Show, h39 w292, Add dealer to CSV
Return
ButtonOK:
Gui, Submit
writethis := Xid . "," . Email . "," . Name
FileAppend, % "`n" writethis, %csv%
Clipboard := Xid
Return
GuiEscape:
GuiClose:
ExitApp
Gui, Add, Edit, x5 y5 w55 h20 vXid, xID
Gui, Add, Edit, x65 y5 w100 h20 vName, Name
Gui, Add, Edit, x170 y5 w135 h20 vEmail, Email
Gui, Add, Edit, x310 y5 w100 h20 vUname, Username
Gui, Add, Button, x150 y49 w80 h20 Default, OK
Gui, Show, h30 w415, Add dealer to CSV

97
func.ahk Normal file
View File

@ -0,0 +1,97 @@
#SingleInstance force ; Only one instance at a time
SendMode, Input
FileEncoding, UTF-8 ; Makes sure the special characters dont break stuff
SetWorkingDir, %A_MyDocuments%\D3K ; Make sure we can find the .ahks linked below
d3k_version = 2.5 ; The current version
settini = %A_MyDocuments%\D3Ksettings.ini ; Where the settings ini is
GetDateTime(lang)
{
UTCTimestamp := A_NowUTC ; Grab the current time and date
UTCFormatStr := "yyyy-MM-dd" ; This is what we want it to look like
FormatTime, DateStr, %UTCTimestamp%, %UTCFormatStr% ; format it to make it look like the Date we want
UTCFormatStr := "H:mm' GMT'" ; The time
FormatTime, TimeStr, %UTCTimestamp%, %UTCFormatStr% ; Format the string to be better
if (lang = "en")
{
Return DateStr " at " TimeStr
}
if (lang = "de")
{
Return DateStr " um " TimeStr
}
}
GetInfo(xID) ; Accept what is passed here as the variable "xID" in the script
{
if (xID)
{
Loop, Read, %A_MyDocuments%\Work_Docs\emails.csv ; read every line of "emails.csv"
{
Array := StrSplit(A_LoopReadLine,",") ; split the line at its separating commas to get separate "columns" AKA elements
if InStr(Array[1],xID) ; if at the specified element (1) the specified content (dealers xID) has been found,
Break ; stop searching
}
Test:= {email: Array[2], name: Array[3], user: Array[4]} ; Return the array so we can do {variable}.email and so on
Return Test
}
if !(xID)
{
Return
}
}
;------------------------------------------------------------------------------
; INI Manipulation that supports UTF-8
;------------------------------------------------------------------------------
ini_load(location)
{
out := {}
Loop, Read, %location%
{
RegExMatch(A_LoopReadLine, "(?<=\[).*(?=\])", _RESection) ; Matches section name
RegExMatch(A_LoopReadLine, "(?<Key>.*)=(?<Value>.*)", _) ; Key = _Key, Value = _Value
If (_RESection)
{
_RESection := StrReplace(_RESection, " ", "_")
out[_RESection]:={}
currentSection := _RESection
} Else {
If (_Value)
{
_Key := StrReplace(_Key, " ", "_")
out[currentSection][_Key] := _Value
}
}
}
Return out
}
ini_getValue(location, inSec, inKey)
{
ini_loaded := {}
ini_loaded := ini_load(location)
inSec := StrReplace(inSec, " ", "_")
inKey := StrReplace(inKey, " ", "_")
Return ini_loaded[inSec][inKey]
}
ini_writeValue(location, inKey, inValue)
{
FileRead, tempini, %location%
needle := inKey . "=.*"
replacement := inKey . "=" . inValue
tempini := RegExReplace(tempini, needle, replacement,, 1)
WinWaitNotActive, GloVar.ini
FileAppend, %tempini%, tempini ; Append the fixed ini to a new file
FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents
FileDelete, tempini ; Delete the fixed temporary ini
}

15
glovarsource Normal file
View File

@ -0,0 +1,15 @@
[Serial Numbers]
1=
ch=
2=
MTG=
VIN=
[Operations Center]
usr=
org=
[Info]
case=
dus=
dnm=
dem=
xID=