I am trying to create a script, which can recieve HTML input in various ways.
Single line text with variables
Multi line text with variables
Static file
Incoming job or
Dataset
When using the Single/multi line text with variables a variable as [Job.NameProper] or [Job.PrivateData:Key="UUID"] gets replaced with the correct values.
But if I read a static file with this content in my script the variables are not replaced.
In the case of something with variables, it is Switch that evaluates the input before passing it to your script. In the case of a static file, Switch does not read the file, it only gives you the path. It is your script that reads the file, so any string replacements in the file are up to your script. You can do what you want by searching with a regular expression that returns a list of matches and you loop over the matches to replace them.
You could also use the "String Replace" app: inject your static file, send it through "String Replace", pick it up as a dataset and use the dataset in your script.
Note that in either case you can also work with your own variable strings in the static file, they do not have to be Switch variables.