JSON Editor & JsonBox()

Post your working scripts, libraries and tools for AHK v1.1 and older
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

JSON Editor & JsonBox()

08 May 2018, 12:05

This is just a simple GUI with an ActiveX control, that loads the html from jsoneditor (https://github.com/josdejong/jsoneditor).

JSONEditor.ahk

Image

JsonBox.ahk (Require Jxon.ahk by CoCo)

JsonBox(ByRef json = "" [, title = "", mode = "code", gui_option = "w700 h560"])
  • json: Json string or AHK object
  • title: Window title
  • mode: Value can be tree, view, form, code, text
Examples:

Code: Select all

obj := { items: ["a", "b"], key1: "value2", key2: "value2" }
JsonBox(obj)

Code: Select all

whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.Open("GET", "https://httpbin.org/get?key=val")
whr.Send()

JsonBox(whr.ResponseText,, "view") ; Display the data in 'view' mode
JsonBox(whr.ResponseText)
MsgBox % whr.ResponseText
:arrow: Github Page
Last edited by tmplinshi on 08 Jan 2019, 01:02, edited 4 times in total.
burque505
Posts: 1736
Joined: 22 Jan 2017, 19:37

Re: JSON Editor

10 May 2018, 07:52

Thanks, tmplinshi, it works great for me, AHK_L 1.1.28.02, Win7 64-bit.
This will probably make a good addition to RPA workflows on some platforms, I'm thinking. UiPath comes to mind, since it can run AHK scripts via Autohotkey.dll.
Regards,
burque505
tmplinshi
Posts: 1604
Joined: 01 Oct 2013, 14:57

Re: JSON Editor / MsgBox_Json() / MsgBox_Obj()

09 Jun 2018, 04:50

Added 2 functions: MsgBox_Json() and MsgBox_Obj()
Added JsonBox()

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 120 guests