-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskDaddy.au3
More file actions
80 lines (75 loc) · 2.2 KB
/
TaskDaddy.au3
File metadata and controls
80 lines (75 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <Array.au3>
#include "TaskDaddyCore.au3"
#include "TaskDaddyArguments.au3"
#include "TaskDaddyGUI.au3"
AutoItSetOption("MustDeclareVars", 1)
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=TaskDaddy.ico
#AutoIt3Wrapper_UseUpx=N
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Global $InputFile, $FHInputFile, $OOutlook, $StrTask, $LineRead
Global $TaskFields[7]
ParseArguments()
$OOutlook = _OutlookOpen()
If @error Then
MsgBox(16, "Error " & @error, "Unable to open Microsoft Outlook object")
Exit (5)
EndIf
If $InputFile = "" Then
If $IsGUI Then
$StrTask = LoadGUI($ArgTask, "")
$TaskFields = ParseTask($StrTask)
MakeTaskOutlook($OOutlook, $TaskFields)
If @error > 0 Then
MsgBox(16, "TaskDaddy Error", "Unable to create Outlook task """ & $StrTask & """")
EndIf
Else
$TaskFields = ParseTask($ArgTask)
MakeTaskOutlook($OOutlook, $TaskFields)
If @error > 0 Then
MsgBox(16, "TaskDaddy Error", "Unable to create Outlook task """ & $ArgTask & """")
EndIf
EndIf
Else
; TODO: Merge string processing
$FHInputFile = FileOpen($InputFile, 0)
If $FHInputFile = -1 Then
MsgBox(16, "Error " & @error, "Unable to open file""" & $InputFile & """")
Exit (51)
EndIf
While 1
$GuiReturnedSkip = False
$LineRead = FileReadLine($FHInputFile)
If @error = -1 Then ExitLoop
If StringStripWS($LineRead, 3) = "" Then
ContinueLoop
EndIf
If $IsGUI Then
; combo of GUI mode and file input
GUIDelete($frmMain)
$StrTask = LoadGUI($LineRead, $InputFile)
If $GuiReturnedSkip Then
ContinueLoop
EndIf
If $GuiReturnedCancelAll Then
ExitLoop
EndIf
$TaskFields = ParseTask($StrTask)
MakeTaskOutlook($OOutlook, $TaskFields)
If @error > 0 Then
MsgBox(16, "TaskDaddy Error", "Unable to create Outlook task """ & $StrTask & """")
EndIf
Else
$TaskFields = ParseTask($LineRead)
MakeTaskOutlook($OOutlook, $TaskFields)
If @error > 0 Then
MsgBox(16, "TaskDaddy Error", "Unable to create Outlook task """ & $LineRead & """")
EndIf
EndIf
WEnd
FileClose($FHInputFile)
Exit (0)
EndIf
Func LaunchHelp()
ShellExecute("hh.exe", @ScriptDir & "\TaskDaddy.chm")
EndFunc ;==>LaunchHelp