Any way to select by coordinates?

I'm trying to write a simple script that will select a bunch of elements in my drawing. (And then delete them.)
I've tried to write a command to select a region, and it is kind-of working, but the coordinates I'm trying to feed it just aren't working.
For one, the command is using the last point I touched as its origin (like when you hit enter instead of clicking on a start point) and then the further coordinates are just wildly different from what I would expect. So this just isn't working.

Is there some other way I can select items in a file according to their position? If I could just select (and delete) everything to the left of the drawing's origin, that would be all I need to save to a command or a script. But I just can't figure out how to get that without manually selecting everything.