Here you semi-automagically control the Antenna Switch.
You can chose between reading the current operating frequency from the Hamlib Server that is controlling the rig or manually select which antenna to use.