Sorry very new to coding and if question seems dumb please apologies and i'm still learning... Thanks for all replies
working code
Code: Select all
var := Map('value1', 'answer1','value2', 'answer2')
m := Menu()
submenu := Menu()
For varname in var
submenu.Add varname, funcgo
m.Add 'Main menu', submenu
funcgo(varname, varPos, m) {
A_Clipboard := '', A_Clipboard := var[varname]
Send '^v'
}
#x::m.Show
I don't want to hardcode within the Code. it should be dynamically getting from else where for example an url .
I wanted to see what is being returned to item to debug further that's why asked how to display in msg box but i'm running into issues converting http response into map
was thinking to convert it to string and then to map but that did not work.
Not working code
Code: Select all
#Requires AutoHotkey v2.0
url := "https://ahkstorage.blob.core.windows.net/ran/ran.txt" ; Replace with your URL
http := ComObject("WinHttp.WinHttpRequest.5.1")
http.Open("GET", url)
http.Send()
ranvar := http.ResponseText
item1 := string(ranvar)
item := Map(item1)
; msgbox string(item)
m := Menu()
submenu := Menu()
For varname in item
submenu.Add varname, funcgo
m.Add 'Main menu', submenu
funcgo(varname, itemPos, m) {
A_Clipboard := '', A_Clipboard := item[varname]
Send '^v'
}
#x::m.Show
DllCall("SwitchToThisWindow", "UInt", A_ScriptHwnd, "UInt", 1)