Retrieve an item in Menu Tree based on the menu clicked

I would like to ensure that every time I click on a menu in the menu tree component an icon appears on the menu and disappears on the next click. My problem is that in the configuration of the even (onItemClicked) script I don't know how to retrieve the items based on the menu clicked.

Try using event.path in your script. It returns "A list containing the item indexes leading to the item that was clicked".
The result will be in the form [1, 3] for the fourth item on the second level of the menu.

There are popup helpers for "self" and "event" on the Configure Script Action dialog windows which give some help.

2 Likes

Thanks, it works perfectly.

1 Like

Hello, can you show me the script that you wrote?