Skip to content

Commit 7f7b428

Browse files
committed
Updated the CSV Version
Updated to mostly include all of the same features included in the XLSX version
1 parent 74dc42b commit 7f7b428

File tree

2 files changed

+56
-46
lines changed

2 files changed

+56
-46
lines changed

CSV Text Expander/CSV Text Expander.ahk

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,51 @@ SetTitleMatchMode,2 ;Easily find window titles.
1010
; This app works but is incomplete. still needs filtering of special characters and referential file location instead of typing it into the file.
1111

1212

13-
MsgBox, 1, HotStrings by Marc Anderson, This app will enable shortcuts(aka, hotstrings) that will autotype based on a CSV file
13+
MsgBox, 1, AutoHotkey Text Expander, This text expander allows you to automatically convert short phrases into long blocks of text. New shortcuts can be added in the included hotstrings.csv file.`n`nExample, typing <ate will expand into "AutoHotkey Text Expander"`n`nBuilt In Hotstring:`n<now = DateTime(MM/dd/yyyy hh:mm:ss)
14+
IfMsgBox, Cancel
15+
ExitApp
1416
IfMsgBox, OK
15-
; loop through the csv file one line at a time
16-
Loop, read, hotstrings.csv
17-
{
18-
; save the line number to a variable
19-
LineNumber := A_Index -1
20-
21-
; skip the first row of content
22-
IfEqual, A_Index, 1, Continue
23-
24-
; parse each cell into variables
25-
Loop, parse, A_LoopReadLine, CSV
26-
{
27-
; if the cell number is odd, assign the current cell to the HotStringShortCut variable
28-
if ( Mod(A_Index, 2) != 0) {
29-
HotStringShortCut := A_LoopField ;else
30-
; MsgBox, 4, , %LineNumber%-%A_Index% is:`n%A_LoopField%`n%HotStringShortCut%`nContinue?
31-
32-
; if the cell number is even, assign the current cell to the HotStringExtended variable
33-
} else {
34-
HotStringExtended := A_LoopField
35-
; MsgBox, 4, , %LineNumber%-%A_Index% is:`n%A_LoopField%`n%HotStringExtended%`nContinue?
36-
}
37-
38-
; if the cell number is even, assign both variables to a hotkey
39-
if ( Mod(A_Index, 2) = 0) {
40-
; MsgBox, 4, , %HotStringShortCut% - %HotStringExtended%`n`nContinue?
41-
hotstring(":*:" "<" HotStringShortCut, HotStringExtended)
17+
; loop through the csv file one line at a time
18+
Loop, read, hotstrings.csv
19+
{
20+
; save the line number to a variable
21+
LineNumber := A_Index -1
22+
23+
; skip the first row of content
24+
IfEqual, A_Index, 1, Continue
25+
26+
; parse each cell into variables
27+
Loop, parse, A_LoopReadLine, CSV
28+
{
29+
; if the cell number is odd, assign the current cell to the HotStringShortCut variable
30+
if ( Mod(A_Index, 2) != 0) {
31+
HotStringShortCut := A_LoopField ;else
32+
; MsgBox, 4, , %LineNumber%-%A_Index% is:`n%A_LoopField%`n%HotStringShortCut%`nContinue?
33+
34+
; if the cell number is even, assign the current cell to the HotStringExtended variable
35+
} else {
36+
HotStringExtended := A_LoopField
37+
; MsgBox, 4, , %LineNumber%-%A_Index% is:`n%A_LoopField%`n%HotStringExtended%`nContinue?
38+
}
39+
40+
; if the cell number is even, assign both variables to a hotkey
41+
if ( Mod(A_Index, 2) = 0) {
42+
; MsgBox, 4, , %HotStringShortCut% - %HotStringExtended%`n`nContinue?
43+
HotStringExtended := StrReplace(StrReplace(StrReplace(HotStringExtended, "!","{!}"),"`r","{enter}"),A_Space A_Space,"{space 2}")
44+
hotstring(":*:" HotStringShortCut, HotStringExtended)
45+
}
46+
47+
; %LineNumber% is the current row
48+
; %A_Index% is the current column
49+
; %A_LoopField% is the current field
50+
51+
; MsgBox, 4, , Field %LineNumber%-%A_Index% is:`n%A_LoopField%`n`nContinue?
52+
; IfMsgBox, No
53+
; return
4254
}
55+
}
4356

44-
; %LineNumber% is the current row
45-
; %A_Index% is the current column
46-
; %A_LoopField% is the current field
47-
48-
; MsgBox, 4, , Field %LineNumber%-%A_Index% is:`n%A_LoopField%`n`nContinue?
49-
IfMsgBox, No
50-
return
51-
}
52-
}
53-
else IfMsgBox, Cancel
54-
ExitApp
55-
56-
^1::
57-
Reload
58-
Sleep, 2000
57+
:*:<now::
58+
FormatTime, CurrentDateTime,, MM/dd/yyyy hh:mm:ss
59+
SendInput, %CurrentDateTime%
60+
return

CSV Text Expander/hotstrings.csv

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
HotKey,Extended Text
2-
else,Please let me know if there is anything else I can do.
3-
sorry,I am sorry for the inconvenience.
4-
nobil,We do not include billing details with any of our shipments.
2+
<ate,AutoHotkey Text Expander
3+
<sorry,I am sorry for the inconvenience.
4+
<hi,Hello World
5+
<list,"This is the list of items I need from the store.
6+
7+
* Apples
8+
* Oranges
9+
* Paper Towels
10+
11+
That�s it, the end of the list."
12+
test,This is a hotstring without a prefix.

0 commit comments

Comments
 (0)