forked from TLMcode/AHKs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateFinancialPieChart.ahk
52 lines (43 loc) · 1.06 KB
/
CreateFinancialPieChart.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
#include FcnLib.ahk
;this should probably be split into three scripts
;DeleteTraceFile()
date := currenttime("hyphendate")
in =C:\Dropbox\AHKs\gitExempt\usaa_export\%date%-credit-processed.csv
out=C:\Dropbox\AHKs\gitExempt\usaa_export\%date%-credit-graph
FileDelete(out . ".xls" )
Run, scalc.exe "%in%"
ForceWinFocus("Text Import")
Sleep, 2000
Send, {ENTER}
ForceWinFocus("OpenOffice")
Sleep, 100
Send, ^+s
ForceWinFocus("Save As")
Sleep, 100
Send, %out%
Send, {TAB}{DOWN 2}{UP 20}m{ENTER}
Send, {TAB}{ENTER}
Sleep, 2000
ForceWinFocus("OpenOffice")
Send, {RIGHT 9}
;DeleteTraceFile()
Loop, read, REFP\credit-categories.txt
{
category := A_LoopReadLine
thisLine=%category%`t=SUMIF(G2:G5001`;"=%category%"`;D2:D5001)`r`n
GraphCells .= thisLine
}
;AddToTrace(GraphCells)
Clipboard := GraphCells
Sleep, 2000
Send, ^v
ForceWinFocus("Text Import")
Sleep, 100
Send, {ENTER}
;Make the graph
ForceWinFocus("OpenOffice")
Send !ia{TAB}{DOWN 2}{TAB 5}{ENTER}
Sleep, 6000
SaveScreenShot("FinancialChart")
Sleep, 6000
Send, ^s!{F4}