Yes, the connections remain the same. I'm only designing this script for me (although maybe I'll rewrite it so anyone can use it later). Your code worked wonderfully Nimue: but I was wondering if you'd explain the $($1-,1) section to me. I don't understand what this does (and it's obviously how you solved my problem since the rest is virtually the same as my code). Also, why did you re-write everything? Are variables quicker than if statements? Thanks for your help, it's much appreciated.

-Ecks