hello

I have this script that hides specific switchbar buttons:

Code:
alias F8 {
  scon -a toggletabs %hidden
  if (%hidden == $null) set %hidden 1
  else unset %hidden
}
alias -l toggletabs {
  set %x window $iif($0,-w,-h)
  set %y 1
  %x "Status Window"
  while $chan(%y) {
    if $istok(#hellas #jokes-gr #greece #mad #pathfinder,$chan(%y),32) {
      %x $chan(%y)
    }
    inc %y
  }
}


I have this script that navigates using keyboard keys across switchbar buttons:

Code:
alias F2 shift -1
alias F3 shift 1
alias shift {
  ; 1: <1=left 0=same >1=right
  ;
  var %wname, %wlist, %wtype, %ccid = $cid, %cwin = $active
  var %a = 0, %aa = $scon(0), %c = 0, %cc = 0, %n = 0, %nwin = 0
  while (%a < %aa) {
    inc %a
    scon %a
    %c = 0
    %cc = $window(*,0)
    while (%c < %cc) {
      inc %c
      %wtype = $window(*,%c).type
      if ($istok(channel status chat custom fserv get send,%wtype,32)) continue
      %wname = $window(*,%c)
      inc %n
      if ((%ccid == $cid) && (%cwin == %wname)) %nwin = %n
      %wlist = $addtok(%wlist,$+($cid,.,%wname),44)
    }
    scon -r
  }
  ;
  if (%nwin == 0) {
    %nwin = $findtok(%wlist,$wildtok(%wlist,$+($cid,.*),1,44),1,44)
    %nwin = $calc(%nwin + $wildtok(%wlist,$+($cid,.*),0,44))
    if ($1 > 0) dec %nwin
  }
  if ($1 < 0) {
    dec %nwin
    if (%nwin == 0) %nwin = $numtok(%wlist,44)
  }
  elseif ($1 > 0) {
    inc %nwin
    if (%nwin == 0) inc %nwin
  }
  %nwin = $calc(((%nwin - 1) % $numtok(%wlist,44)) + 1)
  %nwin = $gettok(%wlist,%nwin,44)
  if (%nwin != $null) scid $gettok(%nwin,1,46) window -a $+(",$gettok(%nwin,2,46),")
}


how can I make mirc to navigate only the visible (with the second script) switchbar buttons?

thanks