Duh. A user error. No wonder my script didn't work.

Now I get to do all the bad things. Insert maniac laughter here.