Click AutoFocus using Python


I am hoping you can help!

We are trying to write a script for Version 4, yet Python is proving to be more difficult. We had no problems with Version 3 and TCL.

What are a trying to achieve is the following:

  • Deselect Live View (as it is currently active)
  • Click AutoFocus
  • Select Live View

We worked out how to, Deselect Live View (as it is currently active) and then, Select Live View, but we cannot work how to click Autofocus while not in Live View.

Any guidance/help would be greatly appreciated.

Many thanks,


To do auto focus, you can use the “Autofocus” request message.

Here is some sample python code to build this message:

req = {}
req["msg_type"] = "Request"
req["msg_id"] = "Autofocus"
req["msg_seq_num"] = 0
req["CameraSelection"] = "All"

The message is the same, regardless of whether liveview is enabled/disabled.

Apologies for the super late reply, thanks for the code, we’ll add that to our scripts.