# Query textScrollList and optionMenuGrp

**URL:** https://forum.highend3d.com/t/query-textscrolllist-and-optionmenugrp/5232
**Category:** Maya
**Tags:** mel
**Created:** [June 4, 2003, 8:09pm UTC](https://forum.highend3d.com/t/query-textscrolllist-and-optionmenugrp/5232 "2003-06-04T20:09:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dunkel3d](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/dec6dc/32.png) [@dunkel3d](https://forum.highend3d.com/u/dunkel3d)
#### Post date: [June 4, 2003, 8:09pm UTC](https://forum.highend3d.com/t/query-textscrolllist-and-optionmenugrp/5232/1 "2003-06-04T20:09:27Z")

</div>

how do I capture the name of the item selected in the textScrollList and optionMenuGrp?

```
window scrollWindow;
paneLayout;
textScrollList -numberOfRows 8 -allowMultiSelection true
	-append "one" -append "two" -append "three"
	-append "four" -append "five" -append "six"
	-append "seven" -append "eight" -append "nine"
	-append "ten" -append "eleven" -append "twelve"
	-append "thirteen" -append "fourteen" -append "fifteen"
	-selectItem "six"
	-showIndexedItem 4;
showWindow;
```

window -q ........... scrollWindow; ???

```
string $optionWindow = `window -title "Example 1"`;
columnLayout;

//	Create option menu group.
//
string $colors = `optionMenuGrp -label "Colors"`;
menuItem -label "Red";
menuItem -label "Green";
menuItem -label "Left";
menuItem -label "Center";
menuItem -label "Right";
```

showWindow $optionWindow;

window -q ........... optionWindow; ???

S

---

<div class="post-metadata">

### Author: ![gdc](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@gdc](https://forum.highend3d.com/u/gdc)
#### Post date: [June 4, 2003, 8:34pm UTC](https://forum.highend3d.com/t/query-textscrolllist-and-optionmenugrp/5232/2 "2003-06-04T20:34:34Z")

</div>

for the textScrollList:

string $scrollListSelection[]=`textScrollList -q -si < name of scroll list>`;

for the optionMenu:  
string $optionMenuSelection=`optionMenuGrp -q -v < name of optionMenuGrp>`;

When you need to querry things like this it is best to name your controls. ie-

textScrollList -numberOfRows 8 -allowMultiSelection true   
-append "one" -append "two" -append "three"   
-append "four" -append "five" -append "six"   
-append "seven" -append "eight" -append "nine"   
-append "ten" -append "eleven" -append "twelve"   
-append "thirteen" -append "fourteen" -append "fifteen"   
-selectItem "six"   
-showIndexedItem 4 myTextScrollList;

--g

---

<div class="post-metadata">

### Author: ![dunkel3d](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/d/dec6dc/32.png) [@dunkel3d](https://forum.highend3d.com/u/dunkel3d)
#### Post date: [June 4, 2003, 8:56pm UTC](https://forum.highend3d.com/t/query-textscrolllist-and-optionmenugrp/5232/3 "2003-06-04T20:56:34Z")

</div>

Thanks GDC,

When do you use the tick marks syntax:

string $scrollListSelection[]=`textScrollList -q -si < name of scroll list>`;

as opposed to this other syntax:

textScrollList -allowMultiSelection true   
-append "one" -append "two" -append "three" myTextScrollList;

????

S

---

<div class="post-metadata">

### Author: ![gdc](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/g/898d66/32.png) [@gdc](https://forum.highend3d.com/u/gdc)
#### Post date: [June 4, 2003, 10:26pm UTC](https://forum.highend3d.com/t/query-textscrolllist-and-optionmenugrp/5232/4 "2003-06-04T22:26:07Z")

</div>

You use the ticks when you want to capture the output of a command to a varible.  
In   
string $scrollListSelection[]=`textScrollList -q -si < name of scroll list>`;

I want to know what's selected ( -si ) so I use the ticks.

When the textSrollList is created you don't need the ticks because your not capturing the results to a varible.

Hope that makes sense.  
--g
