Getting the text of a list item (not the index)

Hi all,

I have list widget and I want to get the text of the currently selected item.

(I looked at GetValue, but it looks as if it will only return the index of the currently selected item, not the text itself)

Thanks in advance for any help.


Does GetTitle work?

Yes, GetTitle works, but doesn’t GetTitle return the entire list of items in the list (seperated by “|”)? I don’t think there’s an option you can use to pick out one item based on an index.

Ah wait…unless you mean something like this:

Set $title = (GetTitle 1)
Set $item = (Add (GetValue 1) -1)
Set $cmd = {perl -e ‘@items=split(/|/,"} $title {"); print $items[} $item {];’}
Set $itemtext = (GetOutput $cmd 1 -1)

Where $itemtext holds what I’m looking for.

I just tried this out and although it does seem like a roundabout way of doing things, it does work.