chriskroll
08-28-2010, 12:42 AM
Can anyone tell me why the following script works without the macroscript header, but not with it.
macroScript LetsGetBakedLean category:"Subdued Software" toolTip:"Open LetsGetBakedLean" icon:#("LetsGetBaked",1)
(
if $ != undefined then
(
fn checkDialog = (
local hwnd = dialogMonitorOps.getWindowHandle()
local dialogTitle = uiAccessor.getWindowText hwnd
"made it in: "
if (dialogTitle == "Disable Sun Slave Shadows?") then (
uiAccessor.pressButtonByName hwnd "&Yes"
)
if (dialogTitle == "Missing Map Targets") then (
uiAccessor.pressButtonByName hwnd "Continue"
)
if (dialogTitle == "Version control error") then (
uiAccessor.pressButtonByName hwnd "OK"
)
true
)
dialogMonitorOps.interactive = false
dialogMonitorOps.unregisterNotification id:#test
dialogMonitorOps.registerNotification checkDialog id:#test
dialogMonitorOps.enabled = true
fileIn "$userScripts\\LightRigger\\LightRigger.ms"
LightRiggerTGV[3][2].sunmastmultspnr.value=0.65 -- Script Errors out on this line, "no get function for undefined"
This script accesses the UI of another script, LightRigger. I am guessing that embedding all the code as a macroscript somehow changes the scope of the variables, but I don't quite know if it can be fixed. Any thoughts?
macroScript LetsGetBakedLean category:"Subdued Software" toolTip:"Open LetsGetBakedLean" icon:#("LetsGetBaked",1)
(
if $ != undefined then
(
fn checkDialog = (
local hwnd = dialogMonitorOps.getWindowHandle()
local dialogTitle = uiAccessor.getWindowText hwnd
"made it in: "
if (dialogTitle == "Disable Sun Slave Shadows?") then (
uiAccessor.pressButtonByName hwnd "&Yes"
)
if (dialogTitle == "Missing Map Targets") then (
uiAccessor.pressButtonByName hwnd "Continue"
)
if (dialogTitle == "Version control error") then (
uiAccessor.pressButtonByName hwnd "OK"
)
true
)
dialogMonitorOps.interactive = false
dialogMonitorOps.unregisterNotification id:#test
dialogMonitorOps.registerNotification checkDialog id:#test
dialogMonitorOps.enabled = true
fileIn "$userScripts\\LightRigger\\LightRigger.ms"
LightRiggerTGV[3][2].sunmastmultspnr.value=0.65 -- Script Errors out on this line, "no get function for undefined"
This script accesses the UI of another script, LightRigger. I am guessing that embedding all the code as a macroscript somehow changes the scope of the variables, but I don't quite know if it can be fixed. Any thoughts?
