uhm...
my bet is timing.
add "sleep 1" just before the key press line.

wild quess though...
_________________________
!

download KiXnet