I created a simple script that open a query window every time someone on my notify list enters IRC.

Code
on *:NOTIFY: {
  ; Keep the current window active
  var %active_window = $active

  ; Open a query window for the user
  query $nick
  .echo -q $nick $timestamp $+ :: $nick has entered IRC.

  ; Keep the current window active
  ;echo ' $+ %active_window $+ '
  window -a %active_window
}

The first part works. The query window is created, and the echo message written.
But when it goes to activate the previous active window, it throws the following error:

* /window: invalid parameters (line 11, FileName.ini)

I don't know what I'm doing wrong.