if (textNodes.length > 0){
figma.ui.postMessage({ type: ‘text-selected’ })
}
However, I am getting the error stated in the question title. I decided to try just scanning the page instead, since this example was shown in the developers guide. So my new code is this:
Hey @Erica_Luzzi I think I was able to fix your issue. Add [0] after .selection. I’m not super savvy with code so I don’t really know why this fixes it, but it should. Hopefully someone else can help explain it!