I apologise about the length of time it has taken to reply to you! If you are still in need of help with this i have the solution here:
You can use the System Variable $AATaskName$ to get the name of the address. Please bare in mind that this variable will include the full filepath to the task as well. Use some string operations and you will eventually have a variable with just the task name inside of it.
Please see the below code for help:
Variable Operation: $AATaskName$ To $vTaskName$
Variable Operation: $AAApplicationPath$\Automation Anywhere\My Tasks To $vMyTasksPath$
String Operation: Before-After "$vTaskName$"; Before: "$vMyTasksPath$" and assign output to $vTaskName$
String Operation: Before-After "$vTaskName$"; Before: "\" and assign output to $vTaskName$
Message Box: "$vTaskName$"
I hope this helps