Riamus2, I'm fairly certain you already know this. A quick fix to make all the variables local is to add the -l switch after the command
Code:
/set -l %var
. The switch is undocumented in the help file but works just the same as /var.