Cool, I have added some comments back in below. I love documentation ;-)
The last line of code does sometimes not exit the <ALT> mode. Unfortunately, after lots of experimenting I can not pinpoint it to any reproducible situation. In happens sometimes in Play mode, sometimes in Shoot mode. It can happen in seemingly the exact same sequence of events one time and not the other time. Is there any more doc on this feature or anybody got an idea about how to test this further? It sucks for my workflow underwater to have to check/correct whether the camera is in TTL mode or not.
Situatie -1-
The script below is set to be auto executed on startup. Pushing the on button on the camera to get to shooting mode it will be ok exiting the <ALT> mode. Then powering off. Then pushing the on button again it will stay in <ALT> mode.
When I repeated this situation 1, it worked for four times well in a row. Then I took a shot. Right after that, powering off and again on led to the <ALT> mode not ending. Again, unfortunately, repeating the sequence taking the shot failed to reproduce the <ALT> mode not ending; it worked again. Any tips?
@title TTL settD
rem DESCRIPTION:
rem WHAT: This script turns on the TTL mode for the flash if it was not on already.
rem WHEN: This is useful for e.g. underwater photography with Canon S95.
rem WHY: In 'Manual' mode the factory firmware doesn't support TTL.
rem HOW: The script can be set to auto run. No more worries.
rem HISTORY:
rem 2012-01-05 Initial script written by jamesinsummer from:
rem http://chdk.setepontos.com/index.php?topic=5876.msg68670
rem 2012-06-13 Initial adaptation by jurgenfd in same thread.
rem 2014-05-19 JFD Adding auto exit for speedy usage.
get_prop 121 b
if b=0 then
print "Still TTL"
else
set_prop 121 0
print "Now TTL"
endif
exit_alt 0