Unfortunately it does not work this way (without importing java.io.*) - i got this error message:
18:50:46.671 ERROR o.o.c.s.ScriptExecutionThread[:50] - Error during the execution of rule 'test helper': An error occured during the script execution: Could not invoke method: org.apache.commons.lang.StringUtils.replace(java.lang.String,java.lang.String,java.lang.String) on instance: null
And here is the code of my script: (Var_TextToSay is String item from .items file - using it as a global variable)
var String tts1
var String tts2
//Google TTS Engine
var String TTS_Engine = "C:\\Program Files\\VideoLAN\\VLC\\vlc.exe --play-and-exit"
//Microsoft SAPI Engine
//var String TTS_URL = ""
//var String TTS_Engine = "C:\\Program Files\\Balabolka\\balabolka_console.exe -n \"Microsoft Server Speech Text to Speech Voice (ru-RU, Elena)\" -t"
tts1 = Var_TextToSay.state
tts2 = tts1.replace(' ', '&20')
executeCommandLine(TTS_Engine+" "+TTS_URL+tts2+".")