How to select pose bone

this my step click in 3dview test

object A

object B with copy location A


influence = 1 B snap A

step 2

apply visual transform object B

step 3

influence = 0 B didn’t snap A and position at A

all step did in script by

ob = bpy.ops.object.select_name(name = “Cube.002”)

and bpy.ops.object.visual_transform_apply()

how do it for pose bone for


apply visual transform be active at a select pose bone

how to select pose bone

it try for buttom for snap fk–> ik and ik --> fk

thank for read
sorry for my eng