How to send selected text from a note to the search bar in Joplin?

Hello everyone,

I'm trying to find a way to send selected text from my notes to the search bar in Joplin. ChatGPT suggested the following method, but it doesn't seem to work:

await joplin.commands.execute('search', selectedText);

Has anyone else encountered this issue? Is there a different way to achieve this? Any help would be appreciated.

Thanks in advance!