this command works fine if I choose the note and execute the code, but still one thing left: If I do not choose the note that I want to change but choose another one, the command will replace the selected note text. I tried to use openNote command like the code below to make the note selected,but failed.
await joplin.commands.execute("openNote",todoID);
await joplin.commands.execute('textSelectAll')
await joplin.commands.execute('replaceSelection', todo.body + "\n"+ finishedTask)