Scripting question: Text entry from parent cell?

I’m sure I saw a script somewhere but I forgot how it was done: is it possible to use the name of a parent cell to populate all available states of a child cell with its name?
In this example I need “Menu Item” to be used with all states of the text cell. The text cell uses three states for macOS Aqua, macOS dark and Windows with the appropriate font families and sizes. Changing the text currently requires me to select all three states and then type the text in the inspector. A lot of mousing around (plus, I regularly forget to activate all states 🥸).
image

This is the final version of my solution to get mouseovers for each state. I have reduced the widget to the minimum required cells but I need three text cells because macOS Aqua also inverts the text on mouseover, whereas macOS dark and Windows do not. I tried mouse in and mouse leave with a script as well but it had a delay and id not work as I expected as a replacement for mouseover. Also, the script was always lost when the widget was reused somewhere else
I could live with this solution pretty happily if only I did not have to enter the text for both states (normal and mouseover) for each of the three occurrences.
image

Since the complexity we do not allow multi-selection if the cells belong to different widgets, so yes: currently it is a multi-step operation. A script sure is possible, but how to select the cells? Maybe

  • Copy the text to the clipboard
  • Select the “Text”-Cells
  • Run the script

and the script would store the text in the selected cells in each widget. Or we could rely on the hierarchy (or names of the cells :thinking: ) to find the cells where to change the text. Which version would you prefer, or do you have another workflow in mind?

I was thinking I use something like ‘$Name’ for the parent and if something like that is found in the parent, any child cell with a flag to observe such a string would have the parent’s name entered into its text field for all states. That would do the trick.