You cannot apply conditions to the menu itself, only conditions to a menuitem. if the condition fails for the item, all subordinated/nested items are affected as well.

If the menuitems aren't nested under a common item, you have to add your condition to every item:
Code:
menu nicklist {
  $iif($1 == $+($chr(45),psyBNC),nick is $+($chr(45),psyBNC)) : { echo -a Query with +psyBNC }
  $iif($1 != $+($chr(45),psyBNC),Test) : { echo -a Test }
  $iif($1 != $+($chr(45),psyBNC),For) : { echo -a For }
  $iif($1 != $+($chr(45),psyBNC),Fun) : { echo -a Fun }
}

If the menuitems would be nested under a common menuitem, you can apply the condition to this superordinate item, thereby disabling/enabling all menuitems nested under it. You could simply add one "tree" for true, and another one for false:
Code:
menu nicklist {
  $iif($1 == $+($chr(45),psyBNC),psyBNC)
  .nick is $+($chr(45),psyBNC) : { echo -a Query with +psyBNC }
  $iif($1 != $+($chr(45),psyBNC),psyBNC)
  .Test : { echo -a Test }
  .For : { echo -a For }
  .Fun : { echo -a Fun }
}


...or you use a submenu that is only triggered by the $iif condition

Finally, if there's no nesting under a common item, you could use the fact that popups are processed in linear order, e.g.:
Code:
; dummy menu item that calls the custom identifier "nicklistswitch"
menu nicklist {
  $nicklistswitch($iif($1 != $+($chr(45),psyBNC),.enable,.disable)) 
}

; the custom identifier - returning nothing (thus the dummy menu won't show) but switching the group
alias -l nicklistswitch { $1 #nopsyBNC }

; this popup will only show if the condition of the dummy menu item was met
#nopsyBNC off
menu nicklist {
  Test : echo -a Test
  For : echo -a For
  Fun : echo -a Fun
}
#nopsyBNC end
...and you don't need to add the condition to all the items separately smile

Last edited by Horstl; 26/03/09 02:34 PM.