I just looked up Get ( ApplicationVersion ) in the help system.
It returns "Web" followed by the application version for web users. "Web 10.03", for example.
Change the expression in the first line of your script to: LeftWords ( Get ( ApplicationVersion ); 1) = "Web"
and it should work for you.
Good point, well made!
Thanks very much.