> For the complete documentation index, see [llms.txt](https://chaoses-ib.gitbook.io/directory-opus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chaoses-ib.gitbook.io/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh/scriptconfig.zh.md).

# ScriptConfig

**ScriptConfig** 对象可以通过 [**ScriptInitData**](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh/scriptinitdata.zh.md)**.config** 和 [**Script**](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh/script.zh.md)**.config** 属性访问。[**ScriptInitData**](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh/scriptinitdata.zh.md)**.config** 属性允许脚本（在其 [**OnInit**](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh-1/oninit.zh.md) 方法中）指定它支持哪些配置属性，并为它们提供默认值。在 [**OnInit**](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh-1/oninit.zh.md) 中分配的属性将在 Preferences 中供用户编辑，然后其它脚本方法可以使用 [**Script**](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh/script.zh.md)**.config** 访问用户编辑的配置。

| 属性名称                      | 返回值类型     | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \<configuration property> | *variant* | <p><strong>ScriptConfig</strong> 对象的属性完全由脚本本身决定。</p><p>在 <strong>OnInit</strong> 方法中，将您希望为此对象分配的任何配置属性的默认值分配给它。每个默认值的类型控制属性的类型。</p><p>Preferences 页面只支持编辑某些类型的变量，因此您只能分配兼容类型的属性。Preferences 支持：</p><ul><li>布尔选项（<strong>True</strong> 或 <strong>False</strong>） - 变量类型必须为 <em>bool</em></li><li>数字选项 - 变量类型必须为 <em>int</em></li><li>字符串选项 - 变量类型必须为 <em>string</em></li><li>多行字符串选项 - 变量类型必须为 string 并且必须包含至少一对 <em>CR/LF</em>。请注意，尾随的 <em>CR/LF</em> 将从默认值中删除。</li><li>多个字符串选项 - 变量类型必须为 <em>字符串</em> 的 <a href="/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh/vector.zh.md"><strong>Vector</strong></a></li><li>下拉列表 - 变量类型必须为 <a href="/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh/vector.zh.md"><strong>Vector</strong></a>，第一个元素为 <em>int</em>（指定默认选择），其余元素为字符串。</li></ul> |
