Skip to content
Newer
Older
100644 559 lines (535 sloc) 16 KB
ea5a5e8
adam authored
1 ; Texter
2 ; Author: Adam Pash <adam@lifehacker.com>
3 ; Gratefully adapted several ideas from AutoClip by Skrommel:
4 ; http://www.donationcoder.com/Software/Skrommel/index.html#AutoClip
5cd56c7 - Added thanks/attributed Dustin
adam authored
5 ; Huge thanks to Dustin Luck for his contributions
ea5a5e8
adam authored
6 ; Script Function:
7 ; Designed to implement simple, on-the-fly creation and managment
8 ; of auto-replacing hotstrings for repetitive text
9 ; http://lifehacker.com/software//lifehacker-code-texter-windows-238306.php
4de77f4 0.3 Release!
adam authored
10 SetWorkingDir %A_ScriptDir%
ea5a5e8
adam authored
11 #SingleInstance,Force
12 #NoEnv
fa58cee - Made *some* SendPlay/SendInput improvements. Would still like SendI…
adam authored
13 StringCaseSense On
2e65335 - Add option to run at Startup in the Preferences menu
adam authored
14 AutoTrim,off
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
15 SetKeyDelay,-1
ea5a5e8
adam authored
16 SetWinDelay,0
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
17 ;Gosub,UpdateCheck
46d899f Code optimization
dustin authored
18 Gosub,ASSIGNVARS
39d3bda - Add autocorrect files with a fileinstall
adam authored
19 Gosub,RESOURCES
ea5a5e8
adam authored
20 Gosub,READINI
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
21 ;EnableTriggers(true)
ea5a5e8
adam authored
22 Gosub,TRAYMENU
6f15dd5 Began integrating Dustin's awesome optimizations with bundles. So far…
adam authored
23 Gosub,BuildActive
66acc37 Pulled chunks of code into separate files in the includes directory p…
adam authored
24
25 ; Autocorrect and autoclose not yet fully implemented
26 ;if AutoCorrect = 1
27 ; Gosub,AUTOCORRECT
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
28 ;if AutoClose = 1
29 ; Gosub,AUTOCLOSE
737b278 Rolled all my changes back to the 0.2 release, added UpdateCheck and …
adam authored
30
46d899f Code optimization
dustin authored
31 FileRead, EnterKeys, %EnterCSV%
32 FileRead, TabKeys, %TabCSV%
33 FileRead, SpaceKeys, %SpaceCSV%
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
34 FileRead, NoTrigKeys, %NoTrigCSV%
39d3bda - Add autocorrect files with a fileinstall
adam authored
35 FileRead, AutocorrectKeys, %AutocorrectCSV%
24c926b More bundles tweaks - Very close to 0.5 release.
adam authored
36 ;Gosub,GetFileList
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
37 ;Goto Start
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
38 ; WinGet PrevWinID, ID, A
39 ; SetTimer, MonitorWindows, 500
40 Starting=1
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
41 Loop
737b278 Rolled all my changes back to the 0.2 release, added UpdateCheck and …
adam authored
42 {
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
43 ;wait for a matching hotstring
d57b62d - Fixed more modifier bugs
adam authored
44 if (Disable = 1)
b5f7bb0 Fixed/updated disabling Texter through keyboard shortcut or right-cli…
adam authored
45 {
46 continue
47 }
48 if Starting <>
5a6d8f8 Fixed a bug with new trigger mechanism: Hotstrings pairs like a and a…
adam authored
49 {
50 Loop
51 { ;grab input one character at a time looking for a match
d57b62d - Fixed more modifier bugs
adam authored
52 if (Disable = 1)
b5f7bb0 Fixed/updated disabling Texter through keyboard shortcut or right-cli…
adam authored
53 {
54 break
55 }
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
56 Input, UserInput, L1 V M, %EndKeys%
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
57 ;Tooltip, Input received, 10, 10
5a6d8f8 Fixed a bug with new trigger mechanism: Hotstrings pairs like a and a…
adam authored
58 if (SubStr(ErrorLevel, 1, 6) = "EndKey")
59 { ;any end key resets the search for a match
60 PossibleMatch=
61 }
62 else
63 {
64 PossibleMatch=%PossibleMatch%%UserInput%
65 }
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
66 ;Tooltip, PossibleMatch= %PossibleMatch%
5a6d8f8 Fixed a bug with new trigger mechanism: Hotstrings pairs like a and a…
adam authored
67 IfInString, HotStrings, |%PossibleMatch%|
68 { ;found a match - go to trigger search
69 break
70 }
83cca0b - No longer need old MonitorWindows features. Still using to determin…
adam authored
71 } ; end of inside loop
5a6d8f8 Fixed a bug with new trigger mechanism: Hotstrings pairs like a and a…
adam authored
72 }
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
73 PossHexMatch := Hexify(PossibleMatch)
39d3bda - Add autocorrect files with a fileinstall
adam authored
74 ;PHMPipe = |%PossHexMatch%|
75 if AutoCorrect = 1
76 {
6ed7beb - Escape key exits prompt (%p) replacements
adam authored
77 IfInString, AutocorrectKeys, |%PossibleMatch%|
39d3bda - Add autocorrect files with a fileinstall
adam authored
78 {
79 AutoMatch = 1
80 }
81 else
82 {
83 AutoMatch=
84 }
85 }
86 if (Autocorrect = 1 and AutoMatch = 1)
87 {
88 ;msgbox %autocorrectkeys%
89 ;if PossHexMatch in %AutocorrectKeys%
90 ;{ ;matched in triggerless list
91 ReadFrom = %A_ScriptDir%\Active\Autocorrect\replacements
6ed7beb - Escape key exits prompt (%p) replacements
adam authored
92 Match := Hexify(PossibleMatch)
39d3bda - Add autocorrect files with a fileinstall
adam authored
93 ;msgbox %match%
94 if GetKeyState("Shift", "P") ; the following loop prevents the shift key from being stuck, which happens if it's released while the execute thread is in progress
95 {
96 Loop
97 {
98 if GetKeyState("Shift", "P")
99 {
100 continue
101 }
102 else
103 {
104 break
105 }
106 }
107 }
108 ;}
109 }
110 else if PossHexMatch in %NoTrigKeys%
111 {
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
112 Match := PossHexMatch
39d3bda - Add autocorrect files with a fileinstall
adam authored
113 ReadFrom = %A_ScriptDir%\Active\replacements
d57b62d - Fixed more modifier bugs
adam authored
114 if GetKeyState("Shift", "P") ; the following loop prevents the shift key from being stuck, which happens if it's released while the execute thread is in progress
115 {
116 Loop
117 {
118 if GetKeyState("Shift", "P")
119 {
120 continue
121 }
122 else
123 {
124 break
125 }
126 }
127 }
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
128 }
129 else
130 { ;get a single character of input to look for triggers
9c6a953 - Fixed Preferences focus (so first hotkey isn't cleared as soon as w…
adam authored
131 Transform, CtrlC, Chr, 3 ; used for the Ctrl-C check
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
132 Input, UserInput, L1 M, %EndKeys%
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
133 ;Tooltip, ErrorLevel= %ErrorLevel%, 10, 10
134 ;msgbox %userinput%
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
135 AltState := GetKeyState("Alt", "P")
136 CtrlState := GetKeyState("Ctrl", "P")
137 ShiftState := GetKeyState("Shift", "P")
138 LWinState := GetKeyState("LWin", "P")
139 RWinState := GetKeyState("RWin", "P")
140 WinState := LWinState || RWinState
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
141 Modifier=
d57b62d - Fixed more modifier bugs
adam authored
142 if (AltState || CtrlState || WinState || ShiftState)
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
143 {
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
144 if AltState
145 {
146 Modifier = !
d57b62d - Fixed more modifier bugs
adam authored
147 PossibleMatch=
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
148 }
149 if CtrlState
150 {
151 Modifier = %Modifier%^
d57b62d - Fixed more modifier bugs
adam authored
152 PossibleMatch=
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
153 }
154 if ShiftState
155 {
156 Modifier = %Modifier%+
157 }
158 if WinState
159 {
160 Modifier = %Modifier%#
d57b62d - Fixed more modifier bugs
adam authored
161 PossibleMatch=
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
162 }
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
163 }
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
164 if (SubStr(ErrorLevel, 1, 6) = "EndKey")
165 { ;trigger found
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
166 Trigger := SubStr(ErrorLevel, 8)
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
167 if (Trigger = "Backspace")
168 { ; trim possmatch so trigger still works if miskeyed
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
169 Send %Modifier%{BS}
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
170 StringTrimRight, PossibleMatch, PossibleMatch, 1
171 continue
172 }
d57b62d - Fixed more modifier bugs
adam authored
173 Bank = %Trigger%Keys
174 Bank := %Bank%
175 PossHexMatch := Hexify(PossibleMatch)
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
176 if PossHexMatch in %Bank%
177 { ;hotstring/trigger match
39d3bda - Add autocorrect files with a fileinstall
adam authored
178 ReadFrom = %A_ScriptDir%\Active\replacements
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
179 Match := PossHexMatch
180 }
181 else
182 {
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
183 if (AltState && !CtrlState && !ShiftState && !WinState)
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
184 {
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
185 ;Msgbox alt alone
186 if AltState
187 {
188 Send, {Alt Down}`{%Trigger%`}
189 AltState := GetKeyState("Alt", "P")
190 Loop
191 {
192 if AltState
193 {
194 AltState := GetKeyState("Alt", "P")
195 }
196 else
197 {
198 Send, {Alt Up}
199 break
200 }
201 }
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
202 PossibleMatch=
203 Starting=1
d57b62d - Fixed more modifier bugs
adam authored
204 continue
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
205 }
206 }
d57b62d - Fixed more modifier bugs
adam authored
207 else if (AltState || CtrlState || WinState || ShiftState)
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
208 {
209 ;msgbox not alone: %modifier%
210 Send, %Modifier%`{%Trigger%`}
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
211 PossibleMatch=
212 Starting=1
d57b62d - Fixed more modifier bugs
adam authored
213 continue
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
214 }
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
215 else
216 {
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
217 ;MsgBox %Trigger%
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
218 Send, `{%Trigger%`}
d57b62d - Fixed more modifier bugs
adam authored
219 ;msgbox sent trigger
220 PossibleMatch=
221 Starting=1
222 continue
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
223 }
224 ;MsgBox, Trigger=%Trigger%
225 }
226 }
227 }
228 if Match<>
229 {
39d3bda - Add autocorrect files with a fileinstall
adam authored
230 ;msgbox %possiblematch%
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
231 GoSub, EXECUTE
232 PossibleMatch=
233 PossHexMatch=
234 Match=
b5f7bb0 Fixed/updated disabling Texter through keyboard shortcut or right-cli…
adam authored
235 Starting=1
d57b62d - Fixed more modifier bugs
adam authored
236 continue
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
237 }
238 else
239 {
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
240 if AltState
241 {
d57b62d - Fixed more modifier bugs
adam authored
242 Send, {Alt Down}%UserInput%
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
243 AltState := GetKeyState("Alt", "P")
d57b62d - Fixed more modifier bugs
adam authored
244 Loop
245 {
246 if AltState
247 {
248 AltState := GetKeyState("Alt", "P")
249 }
250 else
251 {
252 Send, {Alt Up}
253 break
254 }
255 }
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
256 }
d57b62d - Fixed more modifier bugs
adam authored
257 else if UserInput = %CtrlC% ; this doesn't seem like the best fix, but Ctrl-C was not working correctly w/out
258 { ; all other modifiers + letters seem to be working fine
259 SendInput, ^c
260 PossibleMatch=
261 Starting=1
262 ;msgbox boom hi there
263 continue
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
264 }
d57b62d - Fixed more modifier bugs
adam authored
265 ; else if (Modifier <> && !ShiftState) ;is this even doing anything anymore?
266 ; {
267 ; SendInput,%Modifier%%UserInput%
268 ; msgbox sending
269 ; PossibleMatch=
270 ; Starting=1
271 ; continue
272 ; }
273 ;msgbox sending %userinput%
274 PossibleMatch=%PossibleMatch%%UserInput%
275 ;Tooltip, PossibleMatch= %PossibleMatch%
276 SendRaw, %UserInput% ; SendRaw ensures special characters like #, !, {}, etc. are interpreted and sent correctly
277 Starting=
278 Modifier=
279
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
280 }
d57b62d - Fixed more modifier bugs
adam authored
281
737b278 Rolled all my changes back to the 0.2 release, added UpdateCheck and …
adam authored
282 }
ea5a5e8
adam authored
283 return
284
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
285 ;~$BS::StringTrimRight, PossibleMatch, PossibleMatch, 1
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
286
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
287
ea5a5e8
adam authored
288 EXECUTE:
24c926b More bundles tweaks - Very close to 0.5 release.
adam authored
289 WinGetActiveTitle,thisWindow ; this variable ensures that the active Window is receiving the text, activated before send
49918b3 - Added prompts, tweaked delay
adam authored
290 ;; below added b/c SendMode Play appears not to be supported in Vista
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
291 ;EnableTriggers(false)
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
292 if (A_OSVersion = "WIN_VISTA") or (Synergy = 1)
7da67b5 0.3 release fix, made compatible for Vista, which appears not to acce…
adam authored
293 SendMode Input
294 else
fa58cee - Made *some* SendPlay/SendInput improvements. Would still like SendI…
adam authored
295 SendMode Play ; Set an option in Preferences to enable for use with Synergy - Use SendMode Input to work with Synergy
296 if (ExSound = 1)
46d899f Code optimization
dustin authored
297 SoundPlay, %ReplaceWAV%
ea5a5e8
adam authored
298 ReturnTo := 0
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
299 hexInput:=Dehexify(Match)
24c926b More bundles tweaks - Very close to 0.5 release.
adam authored
300 StringLen,BSlength,hexInput
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
301 Send, {BS %BSlength%}
39d3bda - Add autocorrect files with a fileinstall
adam authored
302 FileRead, ReplacementText, %ReadFrom%\%Match%.txt
6ed7beb - Escape key exits prompt (%p) replacements
adam authored
303 ;msgbox %hexinput%
4de77f4 0.3 Release!
adam authored
304 StringLen,ClipLength,ReplacementText
8f1b2ca - Incorporated Dustin's date/time variables
adam authored
305
306 IfInString,ReplacementText,::scr::
ea5a5e8
adam authored
307 {
589e77c - Improvement to READINI thread, code optimization, and ESC to cancel…
adam authored
308 ;To fix double spacing issue, replace `r`n (return + new line) as AHK sends a new line for each character
309 StringReplace,ReplacementText,ReplacementText,`r`n,`n, All
49918b3 - Added prompts, tweaked delay
adam authored
310 StringReplace,ReplacementText,ReplacementText,::scr::,,
311 IfInString,ReplacementText,`%p
fa58cee - Made *some* SendPlay/SendInput improvements. Would still like SendI…
adam authored
312 {
49918b3 - Added prompts, tweaked delay
adam authored
313 textPrompt(ReplacementText)
6ed7beb - Escape key exits prompt (%p) replacements
adam authored
314 if escapePrompt = 1
315 {
316 Exit
317 }
49918b3 - Added prompts, tweaked delay
adam authored
318 }
319 IfInString,ReplacementText,`%s
320 {
321 StringReplace, ReplacementText, ReplacementText,`%s(, ¢, All
322 Loop,Parse,ReplacementText,¢
fa58cee - Made *some* SendPlay/SendInput improvements. Would still like SendI…
adam authored
323 {
324 if (A_Index != 1)
325 {
49918b3 - Added prompts, tweaked delay
adam authored
326 StringGetPos,len,A_LoopField,)
fa58cee - Made *some* SendPlay/SendInput improvements. Would still like SendI…
adam authored
327 StringTrimRight,sleepTime,A_LoopField,%len%
328 StringMid,thisScript,A_LoopField,(len + 2),
329 Sleep,%sleepTime%
49918b3 - Added prompts, tweaked delay
adam authored
330 ;WinActivate,%thisWindow% The assumption must be made that in script mode
331 ; the user can intend to enter text in other windows
fa58cee - Made *some* SendPlay/SendInput improvements. Would still like SendI…
adam authored
332 SendInput,%thisScript%
333 }
334 else
49918b3 - Added prompts, tweaked delay
adam authored
335 {
336 ;WinActivate,%thisWindow% The assumption must be made that in script mode
337 ; the user can intend to enter text in other windows
fa58cee - Made *some* SendPlay/SendInput improvements. Would still like SendI…
adam authored
338 SendInput,%A_LoopField%
49918b3 - Added prompts, tweaked delay
adam authored
339 }
fa58cee - Made *some* SendPlay/SendInput improvements. Would still like SendI…
adam authored
340 }
341 }
342 else
49918b3 - Added prompts, tweaked delay
adam authored
343 SendInput,%ReplacementText%
ea5a5e8
adam authored
344 return
345 }
346 else
347 {
589e77c - Improvement to READINI thread, code optimization, and ESC to cancel…
adam authored
348 ;To fix double spacing issue, replace `r`n (return + new line) as AHK sends a new line for each character
349 ;(but only in compatibility mode)
350 if MODE = 0
351 {
352 StringReplace,ReplacementText,ReplacementText,`r`n,`n, All
353 }
8f1b2ca - Incorporated Dustin's date/time variables
adam authored
354 IfInString,ReplacementText,`%c
355 {
356 StringReplace, ReplacementText, ReplacementText, `%c, %Clipboard%, All
357 }
358 IfInString,ReplacementText,`%t
359 {
360 FormatTime, CurrTime, , Time
361 StringReplace, ReplacementText, ReplacementText, `%t, %CurrTime%, All
362 }
363 IfInString,ReplacementText,`%ds
364 {
365 FormatTime, SDate, , ShortDate
366 StringReplace, ReplacementText, ReplacementText, `%ds, %SDate%, All
367 }
368 IfInString,ReplacementText,`%dl
ea5a5e8
adam authored
369 {
8f1b2ca - Incorporated Dustin's date/time variables
adam authored
370 FormatTime, LDate, , LongDate
371 StringReplace, ReplacementText, ReplacementText, `%dl, %LDate%, All
ea5a5e8
adam authored
372 }
49918b3 - Added prompts, tweaked delay
adam authored
373 IfInString,ReplacementText,`%p
374 {
375 textPrompt(ReplacementText)
6ed7beb - Escape key exits prompt (%p) replacements
adam authored
376 if escapePrompt = 1
377 {
378 return
379 }
49918b3 - Added prompts, tweaked delay
adam authored
380 }
8f1b2ca - Incorporated Dustin's date/time variables
adam authored
381 IfInString,ReplacementText,`%|
ea5a5e8
adam authored
382 {
a037f11 - Hopefully finalized 0.2 release of Texter - included another change…
adam authored
383 ;in clipboard mode, CursorPoint & ClipLength need to be calculated after replacing `r`n
384 if MODE = 0
385 {
386 MeasurementText := ReplacementText
387 }
388 else
389 {
390 StringReplace,MeasurementText,ReplacementText,`r`n,`n, All
391 }
392 StringGetPos,CursorPoint,MeasurementText,`%|
8f1b2ca - Incorporated Dustin's date/time variables
adam authored
393 StringReplace, ReplacementText, ReplacementText, `%|,, All
a037f11 - Hopefully finalized 0.2 release of Texter - included another change…
adam authored
394 StringReplace, MeasurementText, MeasurementText, `%|,, All
395 StringLen,ClipLength,MeasurementText
ea5a5e8
adam authored
396 ReturnTo := ClipLength - CursorPoint
397 }
a037f11 - Hopefully finalized 0.2 release of Texter - included another change…
adam authored
398
8f1b2ca - Incorporated Dustin's date/time variables
adam authored
399 if MODE = 0
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
400 {
401 if ReturnTo > 0
402 {
cb921cf - 0.4 Release
adam authored
403 if ReplacementText contains !,#,^,+,{
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
404 {
49918b3 - Added prompts, tweaked delay
adam authored
405 WinActivate,%thisWindow%
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
406 SendRaw, %ReplacementText%
407 Send,{Left %ReturnTo%}
408 }
409 else
49918b3 - Added prompts, tweaked delay
adam authored
410 {
411 WinActivate,%thisWindow%
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
412 Send,%ReplacementText%{Left %ReturnTo%}
49918b3 - Added prompts, tweaked delay
adam authored
413 }
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
414 }
415 else
49918b3 - Added prompts, tweaked delay
adam authored
416 {
417 WinActivate,%thisWindow%
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
418 SendRaw,%ReplacementText%
49918b3 - Added prompts, tweaked delay
adam authored
419 }
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
420 }
8f1b2ca - Incorporated Dustin's date/time variables
adam authored
421 else
422 {
423 oldClip = %Clipboard%
424 Clipboard = %ReplacementText%
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
425 if ReturnTo > 0
49918b3 - Added prompts, tweaked delay
adam authored
426 {
427 WinActivate,%thisWindow%
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
428 Send,^v{Left %ReturnTo%}
49918b3 - Added prompts, tweaked delay
adam authored
429 }
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
430 else
49918b3 - Added prompts, tweaked delay
adam authored
431 {
432 WinActivate,%thisWindow%
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
433 Send,^v
49918b3 - Added prompts, tweaked delay
adam authored
434 }
8f1b2ca - Incorporated Dustin's date/time variables
adam authored
435 Clipboard = %oldClip%
436 }
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
437 ; if ReturnTo > 0
438 ; Send, {Left %ReturnTo%}
ee2ff17
adam authored
439
ea5a5e8
adam authored
440 }
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
441 SendMode Event
4de77f4 0.3 Release!
adam authored
442 IniRead,expanded,texter.ini,Stats,Expanded
443 IniRead,chars_saved,texter.ini,Stats,Characters
444 expanded += 1
445 chars_saved += ClipLength
446 IniWrite,%expanded%,texter.ini,Stats,Expanded
447 IniWrite,%chars_saved%,texter.ini,Stats,Characters
ea5a5e8
adam authored
448 Return
449
450 HOTKEYS:
451 StringTrimLeft,hotkey,A_ThisHotkey,1
452 StringLen,hotkeyl,hotkey
453 If hotkeyl>1
454 hotkey=`{%hotkey%`}
455 Send,{SC77}
456 Return
457
46d899f Code optimization
dustin authored
458 ASSIGNVARS:
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
459 Version = 0.6
6f15dd5 Began integrating Dustin's awesome optimizations with bundles. So far…
adam authored
460 EnterCSV = %A_ScriptDir%\Active\bank\enter.csv
461 TabCSV = %A_ScriptDir%\Active\bank\tab.csv
462 SpaceCSV = %A_ScriptDir%\Active\bank\space.csv
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
463 NoTrigCSV = %A_ScriptDir%\Active\bank\notrig.csv
6ed7beb - Escape key exits prompt (%p) replacements
adam authored
464 AutocorrectCSV = %A_ScriptDir%\Active\Autocorrect\pipelist.txt
46d899f Code optimization
dustin authored
465 ReplaceWAV = %A_ScriptDir%\resources\replace.wav
466 TexterPNG = %A_ScriptDir%\resources\texter.png
467 TexterICO = %A_ScriptDir%\resources\texter.ico
468 StyleCSS = %A_ScriptDir%\resources\style.css
39d3bda - Add autocorrect files with a fileinstall
adam authored
469 Throbber = %A_ScriptDir%\resources\throbber.gif
685e969 - Changed the Special Key to vkFF, which shouldn't inadvertently fire…
adam authored
470 SpecialKey = vkFF
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
471 EndKeys={Enter}{Esc} {Tab}{Right}{Left}{Up}{Down}{Del}{BS}{Home}{End}{PgUp}{PgDn}{%SpecialKey%}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}
b5f7bb0 Fixed/updated disabling Texter through keyboard shortcut or right-cli…
adam authored
472 Disable = 0
46d899f Code optimization
dustin authored
473 return
474
24c926b More bundles tweaks - Very close to 0.5 release.
adam authored
475 READINI:
a468ecd Use variable for version number - only one place to change for future…
dustin authored
476 IniWrite,%Version%,texter.ini,Preferences,Version
859e128 - Implemented disable via global hotkey
adam authored
477 IniWrite,0,texter.ini,Settings,Disable
589e77c - Improvement to READINI thread, code optimization, and ESC to cancel…
adam authored
478 cancel := GetValFromIni("Cancel","Keys","{Escape}") ;keys to stop completion, remember {}
479 ignore := GetValFromIni("Ignore","Keys","{Tab}`,{Enter}`,{Space}") ;keys not to send after completion
698eb1e - Optimized Texter so it's more likely to work as expected - Left Mou…
adam authored
480 IniWrite,{Escape}`,{Tab}`,{Enter}`,{Space}`,{Left}`,{Right}`,{Up}`,{Down},texter.ini,Autocomplete,Keys
481 keys := GetValFromIni("Autocomplete","Keys","{Escape}`,{Tab}`,{Enter}`,{Space}`,{Left}`,{Right}`,{Esc}`,{Up}`,{Down}")
589e77c - Improvement to READINI thread, code optimization, and ESC to cancel…
adam authored
482 otfhotkey := GetValFromIni("Hotkey","OntheFly","^+H")
76f8178 Another 0.4 release - fixed a few bugs
adam authored
483 managehotkey := GetValFromIni("Hotkey","Management","^+M")
859e128 - Implemented disable via global hotkey
adam authored
484 disablehotkey := GetValFromIni("Hotkey", "Disable","")
589e77c - Improvement to READINI thread, code optimization, and ESC to cancel…
adam authored
485 MODE := GetValFromIni("Settings","Mode",0)
486 EnterBox := GetValFromIni("Triggers","Enter",0)
487 TabBox := GetValFromIni("Triggers","Tab",0)
488 SpaceBox := GetValFromIni("Triggers","Space",0)
fa58cee - Made *some* SendPlay/SendInput improvements. Would still like SendI…
adam authored
489 ExSound := GetValFromIni("Preferences","ExSound",1)
490 Synergy := GetValFromIni("Preferences","Synergy",0)
39d3bda - Add autocorrect files with a fileinstall
adam authored
491 Autocorrect := GetValFromIni("Preferences","AutoCorrect",1)
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
492 Default := GetValFromIni("Bundles","Default",1)
39d3bda - Add autocorrect files with a fileinstall
adam authored
493 OnStartup := GetValFromIni(Settings, Startup, 0)
399f93d - Fixed a couple of minor bugs in 0.2 after testing
adam authored
494
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
495
496
497
4de77f4 0.3 Release!
adam authored
498 ;; Enable hotkeys for creating new keys and managing replacements
499 if otfhotkey <>
e51f463
adam authored
500 {
501 Hotkey,IfWinNotActive,Texter Preferences
502 Hotkey,%otfhotkey%,NEWKEY
503 Hotkey,IfWinActive
504 }
4de77f4 0.3 Release!
adam authored
505 if managehotkey <>
e51f463
adam authored
506 {
507 Hotkey,IfWinNotActive,Texter Preferences
4de77f4 0.3 Release!
adam authored
508 Hotkey,%managehotkey%,MANAGE
e51f463
adam authored
509 Hotkey,IfWinActive
698eb1e - Optimized Texter so it's more likely to work as expected - Left Mou…
adam authored
510 }
b7a1050 Printable css sheet, new SendPlay/SendInput modes used
adam authored
511
859e128 - Implemented disable via global hotkey
adam authored
512 if disablehotkey <>
513 {
514 Hotkey,IfWinNotActive,Texter Preferences
515 Hotkey,%disablehotkey%,DISABLE
516 Hotkey,IfWinActive
517 }
518
83cca0b - No longer need old MonitorWindows features. Still using to determin…
adam authored
519 ~LButton::PossibleMatch=
520 ~RButton::PossibleMatch=
521 ~MButton::PossibleMatch=
ea5a5e8
adam authored
522
66acc37 Pulled chunks of code into separate files in the includes directory p…
adam authored
523 ; GUI
524 #Include includes\GUI\newkey_GUI.ahk ; the GUI for new on-the-fly hotstring creation
525 #Include includes\GUI\traymenu_GUI.ahk ; Builds the right-click system tray menu
526 #Include includes\GUI\about_GUI.ahk ; About Texter GUI window
527 #Include includes\GUI\help_GUI.ahk ; Help dialog/window
528 #Include includes\GUI\preferences_GUI.ahk ; Preferences GUI and accept/cancel threads
529 #Include includes\GUI\management_GUI.ahk ; Implementation of the hotstring management GUI
530 #Include includes\GUI\textprompt_GUI.ahk ; GUI that prompts for text when %p operator is included
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
531 #Include includes\GUI\disablechecks.ahk ; Keeps instant exclusive from tab, enter, and space keys (greys out others)
532
66acc37 Pulled chunks of code into separate files in the includes directory p…
adam authored
533
534 ; Functions
535 #Include includes\functions\disable.ahk ; Disable/enable Texter... need to check if this is still in use (not sure it is)
536 #Include includes\functions\urls.ahk ; Links to Texter homepage and usage instructions
537 #Include includes\functions\getfilelist.ahk ; Loops the main %A_ScriptDir%\replacements\*.txt dir and gathers the list of replacements
538 #Include includes\functions\buildactive.ahk ; Loops the enabled bundles and builds the active set of replacements in Active\replacements\ and Active\replacements
539 #Include includes\functions\bundles.ahk ; Implementation for working with bundles in the management GUI
540 #Include includes\functions\getvalfromini.ahk ; method for writing to ini
541 #Include includes\functions\savehotstring.ahk ; method for saving a new hotstring
542 #Include includes\functions\addtobank.ahk ; method for adding a new hotstring to the bank list of replacements
543 #Include includes\functions\delfrombank.ahk ; method for deleting a hotstring to the bank list of replacements
544 #Include includes\functions\enabletriggers.ahk ; method for enabling/disabling Texter
545 #Include includes\functions\resources.ahk ; Installs file resources like images and sounds
546 #Include includes\functions\printablelist.ahk ; Builds Texter Replacement Guide HTML file
547 #Include includes\functions\updatecheck.ahk ; If enabled, checks for updates to Texter on startup
9c9a5e9 - Adjusted the modifier keys so that they compensate for modifier com…
adam authored
548 ; #Include includes\functions\hexall.ahk ; Converts pre-0.5 version of Texter to the new hexified replacement format... may remove in future versions
66acc37 Pulled chunks of code into separate files in the includes directory p…
adam authored
549 #Include includes\functions\hexify.ahk ; Translates back and forth between hex values for replacements
9bb3b76 Included Dustin's InsSpecKeys.ahk function for special key insertion …
adam authored
550 #Include includes\functions\InsSpecKeys.ahk ; Insert special characters in Texter script mode by pressing insert and then the special key
e8ca640 Incorporated Dustin's new and improved triggering method. Status: wor…
adam authored
551 #Include includes\functions\MonitorWindows.ahk ; monitors active window and clears input when window switches
39d3bda - Add autocorrect files with a fileinstall
adam authored
552 #include includes\functions\renameHotstring.ahk ; rename hotstrings in the Texter Management GUI via the right-click context menu
553 #include includes\functions\InstallAutocorrect.ahk ; sets up autocorrect folder when Texter is first run
66acc37 Pulled chunks of code into separate files in the includes directory p…
adam authored
554
8d1972c - Lots of small fixes, including GUI fixes for instant replacements
adam authored
555 ;#Include includes\functions\autocorrect.ahk ; Spelling autocorrect--may implement in 0.6
66acc37 Pulled chunks of code into separate files in the includes directory p…
adam authored
556 ; #Include includes\functions\autoclose.ahk ; Automatically closes bracketed puntuation, like parentheticals - not currently implemented
24c926b More bundles tweaks - Very close to 0.5 release.
adam authored
557
ea5a5e8
adam authored
558 EXIT:
559 ExitApp
Something went wrong with that request. Please try again.