Or you could employ a different logic altogether: since your script always knows when text is added/removed (assuming the user doesn't type /did -a/-r himself!), you can do what you want at those moments. More specifically

[*]Open your dialog with the button disabled.
[*]Whenever the sclick event for that listbox fires, it means a (non-empty) line was selected, so enable the button.
[*]Whenever something is removed from the listbox, check $did().sel (either $did(id,0).sel or $did(id,1).sel). If it's 0, disable the button.
[*]Whenever the listbox is overwritten with text (eg a file is loaded over any existing text), disable the button.

Last edited by qwerty; 11/05/06 05:01 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com