Quote:
I tried that, but it doesn't work in a script for some reason...

post your script here so we can see what it is that is wrong