I'm having some diffiuclty with this. I'm doing this numerous times with DRO's, but the text box seems to be an issue. This is how I'm doing it with DRO's and it works great. I figured the same approach would work with text boxes....
First, I save the text box value in the On Modify Script like this...
local inst = mc.mcGetInstance()
local val = scr.GetProperty("twFileName", "Value")
mc.mcProfileWriteString(inst, "PersistentDROs", "twFileName", string.format (val))
Then inside a Lua module, I try to read the value like this. The code executes, but always returns "Error", which I'm assuming means that it's not finding the key value.
----------------------------------------------------------------
-- Get parameters
----------------------------------------------------------------
function getParam(key)
local inst = mc.mcGetInstance()
local theParam = mc.mcProfileGetString(inst,'PersistentDROs',key,'Error')
return theParam
end
----------------------------------------------------------------
-- Display file name to dialog
----------------------------------------------------------------
function TW.ShowFileName()
f = getParam('twFileName')
wx.wxMessageBox(f)
end
I can do this in a button event script as well, but I wasn't able to read the text box value there either. Any idea what I'm doing wrong? This works fine with DRO's.
Thanks