If you add an echo for the parameters at the start of the on TEXT event, eg. echo 1: $1 2: $2 3: $3, do you see the expected values?