# Tab expansion in dynamic button labels

**URL:** <https://resource.dopus.com/t/tab-expansion-in-dynamic-button-labels/60770>\
**Category:** Help & Support\
**Tags:** script\
**Created:** [October 25, 2026, 7:10pm UTC](https://resource.dopus.com/t/tab-expansion-in-dynamic-button-labels/60770 "2026-10-25T19:10:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lxp](https://resource.dopus.com/user_avatar/resource.dopus.com/lxp/32/33734_2.png) [@lxp](https://resource.dopus.com/u/lxp)\
**Post date:** [October 25, 2026, 7:10pm UTC](https://resource.dopus.com/t/tab-expansion-in-dynamic-button-labels/60770/1 "2026-10-25T19:10:52Z")

</div>

The string `\t` in the label of a dynamic button will be expanded to a tab. This can happen for instance if the label is path:

```javascript
button.label = item;

```

 ![image](https://resource.dopus.com/uploads/default/original/3X/f/8/f8c8a6f185ba3b84cfa3a9e5e5a7e65487c774db.png)

Is this by design?

If so, I'd just escape the label:

```javascript
button.label = String(item).replace(/\\t/g, '\\\\t');

```

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [October 26, 2026, 11:55am UTC](https://resource.dopus.com/t/tab-expansion-in-dynamic-button-labels/60770/2 "2026-10-26T11:55:39Z")

</div>

It depends what `notablabel` is set to.

You'll definitely need to double `&` characters, though. My [example script](https://resource.dopus.com/t/find-as-you-type-fayt-scripts/44736/2) does it with a function:

```auto
function DoubleAmpersands(str)
{
	return str.replace(/&/g,"&&");
}

```

I've improved the docs in [ButtonData [Directory Opus Manual]](https://docs.dopus.com/doku.php?id=reference:scripting_reference:scripting_objects:buttondata) to mention ampersands and cross-reference the `notablabel` property when describing the `label` property.
