Automatic variables $(TASK_NAME) and $(GROUP_NAME)?

From within a TEDDY task, I would like to get the name of the task defined in the tree (in SSD) and ideally also the name of the group it belongs to.
That is what I call $(TASK_NAME) and $(GROUP_NAME) although these automatic variables do not exist.
Is there a way to retrieve such contextual info from a CADINP script?

Alternatively, is there a way to automatically name the tasks using variables.
This way we can achieve a consistent naming convention.