-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathexport.ahk
63 lines (55 loc) · 1.65 KB
/
export.ahk
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
#SingleInstance,Force
#NoEnv
SetWorkingDir, "%A_ScriptDir%"
FileRead, EnterKeys, %A_WorkingDir%\bank\enter.csv
FileRead, TabKeys, %A_WorkingDir%\bank\tab.csv
FileRead, SpaceKeys, %A_WorkingDir%\bank\space.csv
Gosub,Export
return
EXPORT:
Loop,bundles\*,2
{
Bundles = %Bundles%|%A_LoopFileName%
thisBundle = %A_LoopFileName%
Loop,bundles\%A_LoopFileName%\replacements\*.txt
{
thisBundle = %thisBundle%%A_LoopFileName%|
}
StringReplace, thisBundle, thisBundle, .txt,,All
StringReplace, thisBundle, thisBundle, %A_LoopFileName%,,
%A_LoopFileName% = %thisBundle%
}
StringReplace, FileList, FileList, .txt,,All
Gui,5: Destroy
Gui,5: font, s12, Arial
Gui,5: Add, Text,x15 y20, Hotstring:
Gui,5: Add, ListBox, 0x8 x13 y40 r15 W100 vExportChoice gShowString Sort,%FileList%
Gui,5: Add, Button,w80 default GExportOK x420 yp+80,&Export
Gui,5: Show, W600 H400, Texter Management
return
ExportOK:
Gui, 5: Submit
Gui, 5: Destroy
IfNotExist %A_WorkingDir%\Texter Export
FileCreateDir,%A_WorkingDir%\Texter Export
Loop,Parse,ExportChoice,|
{
FileCopy,%A_WorkingDir%\replacements\%A_LoopField%.txt,%A_WorkingDir%\Texter Export\%A_LoopField%.txt
if A_LoopField in %EnterKeys%
FileAppend,%A_LoopField%`,,%A_WorkingDir%\Texter Export\enter.csv
if A_LoopField in %TabKeys%
FileAppend,%A_LoopField%`,,%A_WorkingDir%\Texter Export\tab.csv
if A_LoopField in %SpaceKeys%
FileAppend,%A_LoopField%`,,%A_WorkingDir%\Texter Export\space.csv
}
return
GetFileList:
FileList =
Loop, %A_WorkingDir%\replacements\*.txt
{
FileList = %FileList%%A_LoopFileName%|
}
StringReplace, FileList, FileList, .txt,,All
return
ShowString:
return