-
Notifications
You must be signed in to change notification settings - Fork 0
/
DJRef.ahk
146 lines (131 loc) · 3.54 KB
/
DJRef.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
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
;Saving References from TXT list to my Google Library.
;Written by Dieter van der Westhuizen 11-02-2020
#SingleInstance, force
;#NoTrayIcon
#NoEnv
#Persistent
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
SetKeyDelay, 150
SendMode, Input
SetTitleMatchMode, 2
SetDefaultMouseSpeed, 0
SetMouseDelay, 0
SetWinDelay, 500
;;;;;;;;;;;;;;;;;;;;;;;;;;;; Add Buttons ;;;;;;;;;;;;;;;;;;
Gui, Add, button, x2 y2 w75 h40 ,Go
Gui, add, button,x2 y42 w75 h40 ,BibTex
;Gui, Add, button, x2 y42 w28 h20 ,EPR
;Gui, Add, button, x2 y64 w33 h20 ,FPSA
;Gui, Add, button, x2 y86 w45 h20 ,Verified
;Gui, Add, button, x2 y108 w57 h20 ,KeepOpen
;Gui, Add, button, w57 , VolVeri
;Gui, Add, button, x2 y130 w45 h20 ,More
Gui, Add, button, x2 y152 w32 h20 ,Close
Gui, Add, button, x45 y152 w20 h20 ,_i
;Gui, Add, Button, x6 y17 w100 h30 , Ok
;Gui, Add, Button, x116 y17 w100 h30 , Cancel
;;;;;;;;;;;;;;;;;;;;;;;;;;;; Set Window Options ;;;;;;;;;;;;;;
;Gui, +AlwaysOnTop
Gui, -sysmenu +AlwaysOnTop
Gui, Show, , Ref. DJ
WinGetPos,,,,TrayHeight,ahk_class Shell_TrayWnd,,,
height := A_ScreenHeight-270
width := A_ScreenWidth-85
Gui, Margin, 0, 0
;Gui, Add, Picture, x0 y0 w411 h485, picture.png
;Gui -Caption -Border
Gui, Show, x%width% y%height% w80
return
;;;;;;;; This is to read the CSV called aa.csv, parse the data and send to TrakCare window, Results Entry.
ButtonGo:
sleep, 500
IfWinNotExist, ahk_exe chrome.exe
{
MsgBox, Please open the Result Entry Window
Return
}
WinActivate, ahk_exe chrome.exe
;^!U::
FileName := Iohexol-ref-1.csv
Loop, read, Iohexol-ref-1.csv
{
LineNumber := A_Index
Loop, parse, LineNumber, CSV
{
FileReadLine, ReferenceVar, Iohexol-ref-1.csv, LineNumber
WinActivate, ahk_exe chrome.exe
IfWinNotActive, ahk_exe chrome.exe
{
MsgBox, Please open Google Scholar in Chrome
Return
}
send, %ReferenceVar%
sleep, 300
send, {Enter}
sleep, 1000
; Loop, 20
;{
; send, {Tab}
; sleep, 300
;}
;send, {Enter}
MouseClick, Left, 260, 425
sleep, 100
MouseClick, Left, 260, 402
sleep, 100
MouseClick, Left, 260, 375
sleep, 1000
MouseClick, Left, 342, 144
sleep, 500
send, {CtrlDown}a{CtrlUp}
sleep, 200
}
}
return
ButtonBibTex:
sleep, 500
IfWinNotExist, ahk_exe chrome.exe
{
MsgBox, Please open your library in Google Scholar in Chrome
Return
}
WinActivate, ahk_exe chrome.exe
IfWinNotActive, ahk_exe chrome.exe
{
MsgBox, Please open your library in Google Scholar in Chrome
Return
}
Loop, 17
{
MouseClick, Left, 260, 197
sleep, 500
MouseClick, Left, 397, 195
sleep, 200
send, {Down}
send, {Enter}
sleep, 2500
send, {CtrlDown}a{CtrlUp}
sleep, 200
send, {CtrlDown}c{CtrlUp}
sleep, 1000
Bibtex_Info := Clipboard
FileAppend, %Bibtex_Info%, Citations.txt
FileAppend, `n`n, Citations.txt
MouseClick, Left, 30, 60
sleep, 1000
send, {PgDn}{PgDn}{PgDn}{PgDn}
sleep, 300
MouseClick, Left, 726, 729
sleep, 2000
}
return
Escape::Reload
;ExitApp
Return
^!r::Reload ; Assign Ctrl-Alt-R as a hotkey to restart the script.
ButtonClose:
ExitApp
Button_i:
Run, http://github.com/dietervdwes/