In wieviel Tagen habe ich Urlaub ?
Seit wievel Tagen bin ich verheiratet ?
In wieviel Tausend Tagen gehe ich in Rente?
Die Antworten auf diese Fragen gibt ein kleines Skript, dessen Kompilat einfach in die Autostart kopiert wird.
Beispieleinträge sind 2 vorhanden, diese können mit [win]+[r] bearbeitet werden und eigene Ereignisse hinzugefügt werden.
Spoiler
;*** In Anlehnung an http://www.autohotkey.com/board/topic/4279-listview-select-column-and-start-emailurlprogram/ ;*** Thanks to Garry - Gurkentoepfer ; Umgebung #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% SetBatchLines -1 #SingleInstance, force ; Variablen ProgName := "TerminationReminder" IniFile := A_Scriptpath . Progname . ".ini" S=; ; Semicolon is the delimiter - SPACE:(transform,S,chr,32) - ANSI YEN (transform,S,chr,165) InstallVer=1.1 FocussedRow:=0 ; kein Eintrag markiert CountRow:=0 TextArray:={} ; Hauptprogramm Gosub, IniChecker Gosub, IniReader ; Hotkeys #r:: gosub, EditReminds return Esc:: ExitApp return ; Unterprogramme IniChecker: ;--- create a test-file ---- ifnotexist,%IniFile% { e4x= (Ltrim Join`r`n 12.12.2013%s%Kündigung Handyvertrag HTC (Beispieleintrag)%s%nein 06.06.1966%s%Geburtstag Moniqe (Beispieleintrag)%s%Geburtstag Moniqe (Beispieleintrag)%s%ja ) Fileappend,%e4x%`r`n,%IniFile% } return IniReader: CurrentDate := A_YYYY . A_MM . A_DD . "00" . "00" . "00" loop,read,%IniFile% { StringSplit,Feld,A_LoopReadLine,%s% Date := Feld1 Note := Feld2 Flag := Feld3 StringRight, TargetDateYYYY, Date, 4 StringMid, TargetDateMM, Date, 4, 2 Stringleft, TargetDateDD, Date, 2 If Flag = ja TargetDateYYYY := A_YYYY + 1 TargetDate := TargetDateYYYY . TargetDateMM . TargetDateDD . "00" . "00" . "00" EnvSub, TargetDate, CurrentDate, Days If TargetDate < 0 { TimeText := "Seit " TargetDateAbs := Abs(TargetDate) } Else { TimeText := "In " TargetDateAbs := TargetDate } SetFormat, Float, 09.0 ; Zahl mit Nullen links auffüllen auf 9 Stellen TargetDate += 0.0 Key := "Key" . TargetDate Wert:= TimeText . TargetDateAbs . " Tagen " . Note TextArray.Insert((Key),Wert) } For key, Wert in TextArray ; Einträge Sortieren RemindText .= Wert . "`n" MsgBox,,%Progname% v%InstallVer%, Erinnerungen: `n%RemindText%`n`nErinnerungen hinzufügen/ändern mit [win]+[r] return EditReminds: T1=70 ;-- width column-1 T2=350 ;-- width column-2 T3=50 ;-- width column-3 tot:=(T1+T2+T3+5) ;-- width listview Gui, 1:Add, ListView, r10 y0 w%tot% +hscroll altsubmit gLW2 vLV_1, Datum | Ereignis | jWdh LV_ModifyCol(1,T1) ;-- size LV_ModifyCol(2,T2) LV_ModifyCol(3,T3) Gui, 1:Add, Button, y+20 x20 w100 h40 gCancel, Edit beenden Gui, 1:Add, Button, x+20 w100 h40 gDelRow, Markierten Eintrag Löschen Gui, 1:Add, Button, x+20 w100 h40 gChangeRow, Markierten Eintrag ändern Gui, 1:Add, Button, x+20 w100 h40 gAddRow, Eintrag hinzufügen ;Gui, 1:Add, Button, x+20 w100 h40 gWriteFile, OK Gui, 1:Show, , %ProgName% gosub, LoadData WinWaitClose, %ProgName% return 1GuiClose: 1GuiEscape: ExitApp return Cancel: Gui, destroy ;============= Listview event =============================================== LW2: ;CountRow:=LV_GetCount() ; Anzahl der Zeilen if A_GuiEvent = Normal { FocussedRow:=LV_GetNext("Focused") ; Gewählte Zeile LV_GetText(C1,A_EventInfo,1) LV_GetText(C2,A_EventInfo,2) LV_GetText(C3,A_EventInfo,3) } return ;============= End Listview event ============================================ ;------------ fill listview columns ----------- LoadData: FocussedRow:=0 Gui,1:default LV_Delete() I=0 loop,read,%IniFile% { LR:=A_LoopReadLine if LR= continue ;LR:=RegExReplace(LR,"\x20{2,}"," ") ;-- allow only on space LR=%LR% ;-- remove leading space stringsplit,C,LR,%s% ;-- split with delimiter I++ LV_Add("",C1,C2,C3) } ;LV_ModifyCol(1,"SortDesc") ;-- sort column-1 ;LV_ModifyCol(1,"integer") ;LV_ModifyCol(3,"integer") LV_Modify(LV_GetCount(), "Vis") ;-- scrolls to last line GuiControl,1:,ix,%i% return WriteFile: clm=0 ifexist,%IniFile% filedelete,%IniFile% Loop % LV_GetCount("Column") clm++ loop, % LV_GetCount() { RowNum := A_Index loop, %clm% LV_GetText(col%A_Index% , RowNum, a_index) FileAppend, % col1 ";" col2 ";" col3 "`r`n", % IniFile } Gui, destroy return AddRow: Gui,2:Add,Text, x10 y5 w180 h20, Datum Gui,2:Add,Edit, x180 y5 w500 h20 vA21 Gui,2:Add,Text, x10 y30 w180 h20, Ereignis Gui,2:Add,Edit, x180 y30 w500 h20 vA22 Gui,2:Add,Text, x10 y60 w180 h20, jährliche Wiederholung? Gui,2:Add,ListBox, x180 y60 w400 vA23 choose2, ja|nein Gui,2:Add, Button, x10 y90 w80 h25, OK Gui,2:Show, w600 h120, %ProgName% - ADD NEW return 2GuiClose: 2GuiEscape: Gui,2: Destroy return 2ButtonOK: Gui,2:submit FILEAPPEND, %A21%%s%%A22%%s%%A23%`r`n,%IniFile% Gui,2: Destroy GoSub, LoadData ;-- update LV return ChangeRow: if FocussedRow=0 { MsgBox Kein Eintrag markiert return } If C3=ja Item:=1 else Item:=2 Gui,3:Add,Text, x10 y5 w180 h20, Datum Gui,3:Add,Edit, x180 y5 w500 h20 vA31, %C1% Gui,3:Add,Text, x10 y30 w180 h20, Ereignis Gui,3:Add,Edit, x180 y30 w500 h20 vA32, %C2% Gui,3:Add,Text, x10 y60 w180 h20, jährliche Wiederholung? Gui,3:Add,ListBox, x180 y60 w400 vA33 Choose%Item%, ja|nein Gui,3:Add, Button, x10 y90 w80 h25, OK Gui,3:Show, w600 h120, %Progname% - MODIFY return 3ButtonOK: Gui,3:submit FileRead, FileContent, %IniFile% FileDelete, %IniFile% StringReplace, FileContent, FileContent, %C1%%s%%C2%%s%%C3% , %A31%%s%%A32%%s%%A33% FileAppend, %FileContent%, %IniFile% GoSub, LoadData Gui, 3:Destroy return 3GuiClose: 3GuiEscape: Gui, 3:Destroy return DelRow: If FocussedRow=0 { MsgBox Kein Eintrag markiert return } CT=%c1%%s%%c2%%s%%c3% msgbox, 262436,Delete,Möchten Sie die Zeile %FocussedRow% löschen? IfMsgBox,No Return FileRead,AA,%IniFile% Filedelete,%IniFile% StringReplace,BB,AA,%CT%`r`n,, FileAppend,%BB%,%IniFile% gosub,LoadData return
Viel Spaß
Gurkentöpfer