Need to add near-field script to existing POSTFEKO session using Lua
I am trying to add near-field scripts in POSTFEKO using Lua to dynamically generate them.
According to the API reference, I need to do the following:
nearFieldMathScript = app.MathScripts:Add(pf.Enums.MathScriptTypeEnum.NearField)
My problem is with "app".
When I try to use "app = pf.GetApplication()" to define the variable, I get the following error:
".. attempt to index global 'app' (a nil value)"
Any ideas?
Thanks in advance