I think I found a solution: I created a script with the ExecuteInEditMode descriptor.
[ExecuteInEditMode]
public class ChangeTextAccordingtToName : MonoBehaviour {
private string oldName;
public UnityEngine.UI.Text textToChange;
// Update is called once per frame
void Update ()
{
if (name != oldName)
{
if (textToChange != null)
{
textToChange.text = name;
}
}
oldName = name;
}
}