if(get_focus_mode()~=1)then
set_aflock(1)
end
In my experiments with the G1X and sx270, set_aflock(1) ALWAYS autofocuses before it locks. But it may not autofocus successfully, so you can end up with a blurry time lapse. I've tried set_focus(mm) but set_aflock(1) still focuses again.
The G1X has a manual focus mode. I always set manual focus before entering <alt> mode and starting the script. If you set_aflock when in manual focus mode it crashes the sx260 and doesn't work, so I put the test for manual focus before the set_aflock.
To enter manual focus mode, press the left cursor button twice, then set button, and then use the dials to change the focus. If you half press the shutter button and hold it, then press the left cursor, it enters manual focus mode at that focus position, although you can still use the focus dial.
You want to set the manaul focus a little in front of infinity. I usually try to focus on a tree at least 10 meters away if I'm using wide angle. Google "hyperfocal distance" for more info.
If you want to do the time lapse with the screen off, the down cursor button changes the display. It cycles through normal display, extra stuff display (like the tilt indicator), and totally off. If you turn it totally off, then press the <alt> button, then the shutter button, it should start the script with the display off.