Change names of party and arena frames

Hi basically I want to change the names of people in my party and arena frames.

for example the following scripts seem to work:
/script CompactPartyFrameMember2Name:SetText(“1”)
/script CompactPartyFrameMember3Name:SetText(“2”)
/script CompactArenaFrameMember1Name:SetText(“1”)
/script CompactArenaFrameMember2Name:SetText(“2”)
/script CompactArenaFrameMember3Name:SetText(“3”)

however I cant make it persist when I change targets highlight etc or when I logout. Can anyone help? Thanks.