I looked back in my CHDK scripts, and I used the command
to set the focus at infinity, while the exposure is still on automatic.
I am attaching the script file that I use. You can read it in notepad. It takes all of the sensor data from the camera (temps, voltages, time, etc) and logs them onto the camera SD card for later retrieval, in addition to taking the timed photos.
Chuck / KG5CA