-
Notifications
You must be signed in to change notification settings - Fork 0
/
Keyboard Maestro Time Tracker.kmmacros
251 lines (240 loc) · 6.68 KB
/
Keyboard Maestro Time Tracker.kmmacros
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>IsActive</key>
<true/>
<key>Macros</key>
<array>
<dict>
<key>Actions</key>
<array>
<dict>
<key>Buttons</key>
<array>
<dict>
<key>Button</key>
<string>OK</string>
</dict>
<dict>
<key>Button</key>
<string>Cancel</string>
<key>Cancel</key>
<true/>
</dict>
</array>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>PromptForUserInput</string>
<key>Prompt</key>
<string>Please enter a name and choose the project for the new task.</string>
<key>ResultButtonVariable</key>
<string>Result Button</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>Title</key>
<string>Start new task</string>
<key>Variables</key>
<array>
<dict>
<key>Default</key>
<string></string>
<key>Variable</key>
<string>Name</string>
</dict>
<dict>
<key>Default</key>
<string>Project One|Project Two</string>
<key>Variable</key>
<string>Project</string>
</dict>
<dict>
<key>Default</key>
<string></string>
<key>Variable</key>
<string>Notes</string>
</dict>
</array>
</dict>
<dict>
<key>DisplayKind</key>
<string>Briefly</string>
<key>File</key>
<data>
</data>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>ExecuteAppleScript</string>
<key>NewFile</key>
<string></string>
<key>Text</key>
<string>tell application "Keyboard Maestro Engine"
set myName to make variable with properties {name:"Name"}
set theName to value of myName
set myProject to make variable with properties {name:"Project"}
set theProject to value of myProject
set myNotes to make variable with properties {name:"Notes"}
set theNotes to value of myNotes
end tell
tell application "iCal" tell calendar "Work" set theDate to current date set theFullSummary to theProject & ":" & theName make new event at end with properties {description:theNotes, summary:theFullSummary, start date:theDate, end date:theDate + 5 * minutes} end tellend tell
</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>TrimResults</key>
<true/>
<key>UseText</key>
<true/>
<key>Variable</key>
<string>Variable</string>
</dict>
</array>
<key>IsActive</key>
<true/>
<key>Name</key>
<string>1) Start work</string>
<key>Triggers</key>
<array>
<dict>
<key>FireType</key>
<string>Pressed</string>
<key>KeyCode</key>
<integer>115</integer>
<key>MacroTriggerType</key>
<string>HotKey</string>
<key>Modifiers</key>
<integer>4608</integer>
<key>TriggerRepeat</key>
<false/>
</dict>
</array>
<key>UID</key>
<string>DC313367-B42E-4BA4-B2A6-32D7D6AEEE2A</string>
</dict>
</array>
<key>Name</key>
<string>Global Macro Group</string>
<key>UID</key>
<string>E6D5A6B6-0F9A-4B57-9CD8-E58FF7E9F649</string>
</dict>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>IsActive</key>
<true/>
<key>Macros</key>
<array>
<dict>
<key>Actions</key>
<array>
<dict>
<key>DisplayKind</key>
<string>Briefly</string>
<key>File</key>
<data>
</data>
<key>IsActive</key>
<true/>
<key>IsDisclosed</key>
<true/>
<key>MacroActionType</key>
<string>ExecuteAppleScript</string>
<key>NewFile</key>
<string></string>
<key>Text</key>
<string>-- Stop the current task-- Created by Rafael Bugajewski on Tue Aug 30 2011.---- Copyright (c) 2011. All rights reserved.-- http://macscripter.net/viewtopic.php?pid=96383to split(someText, delimiter) set AppleScript's text item delimiters to delimiter set someText to someText's text items set AppleScript's text item delimiters to {""} --> restore delimiters to default value return someTextend splitset theAdjectives to {"awesome", "great", "groovy", "productive", "procreative", "outstanding", "spectacular", "smashing", "highly efficient"}on durationString(theDuration) set theDateString to "" set theMinutes to (theDuration / minutes as integer) if (theDuration / hours > 1) then set theDateString to (theDuration / hours as integer) & " h " set theMinutes to theMinutes - ((theDuration / hours) as integer) * 60 end if set theDateString to theDateString & theMinutes & " min " & theDuration mod minutes & " s" return theDateStringend durationStringtell application "iCal" tell calendar "Work" set theEvent to last event set end date of theEvent to current date end tell set theDuration to (end date of theEvent) - (start date of theEvent) set theStartDate to start date of theEvent set theEndDate to end date of theEvent set theSummary to summary of theEventend tell-- duration (end date of theEvent) - (start date of theEvent)--set theSplitSummary to split(theSummary, ":")"Congratulations, you worked
for " & some item of theAdjectives & " " & durationString(theDuration) & ".
Task: " & item 2 of theSplitSummary & "
Project: " & item 1 of theSplitSummary & "
Start Date: " & time string of theStartDate & " (" & short date string of theStartDate & ")
End Date: " & time string of theEndDate & " (" & short date string of theEndDate & ")"
</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>TrimResults</key>
<true/>
<key>UseText</key>
<true/>
<key>Variable</key>
<string>Variable</string>
</dict>
</array>
<key>IsActive</key>
<true/>
<key>Name</key>
<string>2) Stop Work</string>
<key>Triggers</key>
<array>
<dict>
<key>FireType</key>
<string>Pressed</string>
<key>KeyCode</key>
<integer>119</integer>
<key>MacroTriggerType</key>
<string>HotKey</string>
<key>Modifiers</key>
<integer>4608</integer>
<key>TriggerRepeat</key>
<false/>
</dict>
</array>
<key>UID</key>
<string>A710C115-5985-4161-863C-5A249528EC20</string>
</dict>
</array>
<key>Name</key>
<string>Global Macro Group</string>
<key>UID</key>
<string>E6D5A6B6-0F9A-4B57-9CD8-E58FF7E9F649</string>
</dict>
</array>
</plist>