-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddToDictionary.ahk
26 lines (19 loc) · 1.08 KB
/
AddToDictionary.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
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;Holds intial starting number.
count := 3
F1::
;Display to input boxes to the user, who will enter the question and answer from Freerice.
InputBox, question, Question, What's the question?
InputBox, answer, Answer, %question%?
;Focus on Visual Studio Code so it can insert the code.
WinActivate, ahk_exe Code.exe
;This is the pattern of the code. Only 3 things change, the count, key and value.
SendRaw, <maes:AddToDictionary x:TypeArguments="x:String, x:String" Dictionary="[Dictionary]" DisplayName="Add to dictionary" sap:VirtualizedContainerService.HintSize="397.6,135.2" sap2010:WorkflowViewState.IdRef="AddToDictionary``2_%count%" Key="%question%" Value="%answer%" />
;Count is incremental. Remember to change the initial starting number if needed.
count++
Return
F2::
Reload