Ok, here is the code I tested.
The better approach would probably be to use keypresses.
Code (a590 IS):
@title set focus mode to Macro Mode
rem Let's suppose I change the value of
rem some property. It is a good practice
rem to remember the old value of the property
rem and restore the property value at the
rem end of the script. Otherwise unexpected
rem results can happen. Like the one below.
rem Changing the focus mode to Macro Mode
rem works through set_prop. The camera icon
rem for focus mode doesn't update itself
rem after the change.
rem Also, it seems that after the change,
rem the camera is locked in the mode, that
rem (the mode) I've set through set_prop.
rem Camera is locked even when I change the
rem focus mode through the camera buttons.
rem Or maybe not locked (after switching to
rem Manual Focus mode)
get_prop 6 o
set_prop 6 1
get_prop 6 p
print "Focus mode is:", p
shoot
rem Set the old value of the focus property
rem after taking a picture.
set_prop 6 o
end