Apply an FK/IK switch for all selected rig components. This will bake all animation from the current component to the skeleton, and then build the new IK or FK component, baking the motion to the new controls.
Will only run once per component, no matter how many controls are selected.
Advanced:
It is possible to add RigSwitchProperty nodes to the character skeleton that define how the FK/IK switching works. For example, you could define that instead of an IK switching to FK it should switch to an AimFK component. Or that the IK and FK components should build on different regions when switched.
Script Command:
import rigging.usertools; rigging.usertools.helix_rigger.HelixRigger().ik_fk_switch(None, None)