Vorple - Using JavaScript Return Values

I’m trying to get Inform to set a variable based on what a JavaScript function returns. This is what’s in my Inform code:

Story mode is a truth state that varies.  Story mode is false.

When play begins:
	if Vorple is supported:
		execute JavaScript command "queryPlayMode()";
		if the JavaScript command returned true:
			now story mode is true;
			say "Test succeeded.";
			say "Test failed.";
		say "Hello world.";

And my JavaScript:

function queryPlayMode() {
	return true;

I know it’s calling the function because if I comment it out the interpreter has an error. But that’s all it does. It isn’t changing the variable, and the only text it prints to the screen is “Hello world.” It’s been awhile since I played with Inform so maybe I’m just doing something ridiculous, but I can’t see what’s wrong.

You need to explicitly return the value in the expression:

execute JavaScript command "return queryPlayMode()";

Ah, thank you. I think I remember seeing that in the documentation now. Oops. Unfortunately, fixing that didn’t change what my code is doing so there must be an additional problem.