Code: Select all
[h:newEntry = '[h:weapons = json.append(weapons, json.set("{}", "index", json.length(weapons), "name", "' + name + '", "subtype", "", "damage", ' + damage + ', "qualities", json.append("", "' + list + '")))]']
[h:output = concat(substring(command, 0, index - 1), newEntry, substring(command, index - 1, length(command)))]
[h:setMacroCommand(macroIndex, output)]