# Multiline or JSON ScriptConfig type

**URL:** https://resource.dopus.com/t/multiline-or-json-scriptconfig-type/18755
**Category:** Help & Support
**Created:** [July 16, 2014, 10:43pm UTC](https://resource.dopus.com/t/multiline-or-json-scriptconfig-type/18755 "2014-07-16T22:43:27Z")
**Posts on this page:** 1
**Showing post:** 17

<div class="post-metadata">

### Author: ![wowbagger](https://resource.dopus.com/user_avatar/resource.dopus.com/wowbagger/32/25880_2.png) [@wowbagger](https://resource.dopus.com/u/wowbagger)
#### Post date: [September 17, 2014, 12:31pm UTC](https://resource.dopus.com/t/multiline-or-json-scriptconfig-type/18755/17 "2014-09-17T12:31:55Z")

</div>

Dopus V11.7 has multiline config. Thanks for the update.

I was playing with this today when updating the [Tab-Labelizer](https://resource.dopus.com/t/tab-labelizer-extend-the-folder-names-shown-in-your-tabs/18075/1). I wanted to share my solution.

The Tab-Labelizer has some advanced config that is stored in script as a JSON object. Its to complex to put in to other config types. I wanted to allow the user to edit that confict without opening the script. I also wanted it to look nice, and not to have to store the default config in a string literal as that would require escaping values and make it hard to read.

This is the pattern I used (A cut down version of the code):

```auto
function OnInit(data) {
  data.name = "test multiline script";
  data.desc = "Display advanced JSON config in a multi line config.";
  data.default_enable = true;
  data.min_version = "11.7"

  data.config_desc = DOpus.NewMap();
  
  //Set ExtendedConfig default to be defaultExtendedConfig pretty printed.
  data.config.ExtendedConfig = JSON.stringify(defaultExtendedConfig, undefined, 2).replace(/(\n)+/g,"\r\n");
  data.config_desc("ExtendedConfig") = "Extended configuration, Be careful editing";  
}
 
//Default values for extendedConfig
var defaultExtendedConfig = {
  value1: true,
  value2: "test",
  AGroupOfSettings: {
    enabled: true,
    alist: [
        "value1",
        "value2",
        "value3"
    ]
  },
}

function OnMyCustomFunction(data) {
  var extendedConfig = JSON.parse(Script.config.ExtendedConfig);
  // Do stuff
}
```

Keen to hear any feedback, specifically regarding performance issues. I have a couple of other scripts that could use a similar set-up.

---

_[View the full topic](https://resource.dopus.com/t/multiline-or-json-scriptconfig-type/18755)._
