It will be complicated (head office very tough restrictions) to exchange ShortKeys by AHK but I will try.
So I found this script that I can use to fetch data from an excel file containing the definitions of the ShortKeys. But I need AHK to fire every time //(Key) is typed. In other words pressing "//abc" translates to "Send the sentence (or actions) with abc as its Key" (whatever is in the excel sheet next to abc).
In this script I see that I can use "LookUp[content]" to fetch the definition of the Key, but my coding skills aren't good enough, can anyone help me?
Thank you in advance!
Script to read excel file (reads in the file "read.xlsx"):
Code: Select all
Path := "C:\Users\Desktop\read.xlsx"
XL := ComObjCreate("Excel.Application")
XL.Visible := False
XL_Workbook := XL.Workbooks.Open(Path)
XL_WorkSheet := XL_Workbook.Worksheets(1) ; I'm assuming worksheet 1 here because of the test file
LookUp := {} ; Object to hold lookups
Loop
{
IF (XL_WorkSheet.Range("A" . A_Index).Value)
LookUp[XL_WorkSheet.Range("A" . A_Index).Text] := XL_WorkSheet.Range("B" . A_Index).Text
Else
Break
}
XL.Quit()
Gui, Add, Edit, w100 vcontent,
Gui, Add, Button, gsubmit Default, Submit
#x::Gui, Show, autosize
submit:
Gui, submit,
msgbox, % "the meaning of " . content . " is " . LookUp[content]
Return