by cocobelgica

cocobelgica / AutoHotkey-JSON

JSON module for AutoHotkey

135 Stars 56 Forks Last release: Not found 68 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

JSON and Jxon

JSON lib for AutoHotkey

Requirements: Latest version of AutoHotkey (v1.1+ or v2.0-a+)

Version: v2.1.1 (updated 01/30/2016)

License: WTFPL

JSON.ahk (class)

Works on both AutoHotkey v1.1 and v2.0a



#Include JSON.ahk
or copy into a function library folder and use


Parses a JSON string into an AHK value


value := JSON.Load( text [, reviver ] )

Return Value:

An AutoHotkey value (object, string, number)


  • text [in] - JSON formatted string
  • reviver [in, opt] - function object, prescribes how the value originally produced by parsing is transformed, before being returned. Similar to JavaScript's
    reviver parameter.


Converts an AHK value into a JSON string


str := JSON.Dump( value, [, replacer, space ] )

Return Value:

A JSON formatted string


  • value [in] - AutoHotkey value (object, string, number)
  • replacer [in, opt] - function object, alters the behavior of the stringification process. Similar to JavaScript's
    replacer parameter.
  • space [in, opt] -if space is a non-negative integer or string, then JSON array elements and object members will be pretty-printed with that indent level. Blank(
    ) (the default) or
    selects the most compact representation. Using a positive integer space indents that many spaces per level, this number is capped at 10 if it's larger than that. If space is a string (such as
    ), the string (or the first 10 characters of the string, if it's longer than that) is used to indent each level.

Jxon.ahk (function)

Similar to the JSON class above just implemented as a function. ~~Unlike JSON (class) above, this implementation provides reading from and writing to file~~(Removed

). Works on both AutoHotkey v1.1 and v2.0a



#Include Jxon.ahk
. Must be copied into a function library folder for the latter.


Deserialize src (a JSON formatted string) to an AutoHotkey object


obj := Jxon_Load( ByRef src [ , object_base := "", array_base := "" ] )


  • src [in, ByRef] - JSON formatted string or path to the file containing JSON formatted string.
  • object_base [in, opt] - an object to use as prototype for objects(
    ) created during parsing.
  • array_base [in, opt] - an object to use as prototype for arrays(
    ) created during parsing.


Serialize obj to a JSON formatted string


str := Jxon_Dump( obj [ , indent := "" ] )

Return Value:

A JSON formatted string.


  • obj [in] - this argument has the same meaning as in JSON.Dump()
  • indent [in, opt] - this argument has the same meaning as in JSON.Dump()

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.