Gatewayscript from expression

Dear experts,

We have a gateway script that will translate an integer to a string.
We want to make one general script that does this in case (in the future) new names will be added.

We want to call this script in an expression activated by the onchange value.
The global script has to return the string name to us.

We tried doing this but no succes. What is the correct way to return something from a global script?

In attachment we tried it using that way.

try adding a return to your script

return RecipeName

Then in the your valueChanged script

Recept = project.PT_Recipe.RecipeName(currentValue.value,Recept)
...