Well I finally got this to work. Part of the script is as follows. I did create the UI script to initialize the folder object variable.
' The purpose of this script is to enable tabs based on items selected
' RKL TE 6-28-17
' RKL this script is used to change the functionality
' an appearance of the tabs.
retval = oScript.DebugPrint(""Begin PR_EnableGR_Panels script"")
sItemCode=""""
screenname=""""
panelname=""""
foldername=""""
' Get the item code
retval = oScript.DebugPrint(""Begin Script"")
retval = oBusObj.GetValue(""ItemCode$"",sItemCode)
retval = oScript.DebugPrint(sItemCode & "" Before if"")
' test for the presence of the UI Object if one doesn't exist
' create a connection myUIOBJ to the UI Object.
If (IsObject(oUIObj)) Then
MASUI = True
screenName = oUIObj.GetScreenName()
panelName = oUIObj.GetPanelName()
folderName = oUIObj.GetFolderName()
retval = oScript.DebugPrint(""fIRST "" & screenname &"":""&panelname &"":""&foldername)
Else
myUIOBJ=""""
MASUI = CBool(oScript.UIObj)
retval = oScript.DebugPrint(screenname &"":""&panelname &"":""&foldername)
If (MASUI) Then
Set myUIObj = oSession.AsObject(oScript.UIObj)
screenName = myUIObj.GetScreenName()
panelName = myUIObj.GetPanelName()
folderName = myUIObj.GetFolderName()
End If
End If
retval = oScript.DebugPrint(screenname & panelname & foldername)
IF sItemCode = ""GR1"" THEN
'retVal = myUIObj.SetFolderState(""PNL_CMNEW_1"", ""ENABLE"")
nTabIndex = 7
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Red""""), %FLDR'Redraw(), 'SR', 'CF',"")
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Red""""), %FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 8
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""), %FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 9
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""), %FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 10
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""),%FLDR'Redraw(), 'SR', 'CF',"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_1"", ""ENABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_2"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_3"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_4"", ""DISABLE"")
retval = oScript.DebugPrint(""GR1 panel enabled"")
ELSE
IF sItemCode = ""GR2"" THEN
nTabIndex = 7
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""),%FLDR'DisableTab("" & nTabindex & ""), 'SR', 'CF',"")
nTabIndex = 8
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Red""""), %FLDR'EnableTab("" & nTabindex & ""), %FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 9
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""),%FLDR'DisableTab("" & nTabindex & ""), 'SR', 'CF',"")
nTabIndex = 10
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""),%FLDR'DisableTab("" & nTabindex & ""), 'SR', 'CF',"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_1"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_2"", ""ENABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_3"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_4"", ""DISABLE"")
retval = oScript.DebugPrint(""GR2 panel enabled"")
Else
IF sItemCode = ""GR3"" THEN
nTabIndex = 7
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""), %FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 8
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""),%FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 9
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Red""""), %FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 10
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""),%FLDR'Redraw(), 'SR', 'CF',"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_1"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_2"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_3"", ""ENABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_4"", ""DISABLE"")
retval = oScript.DebugPrint(""GR3 panel enabled"")
Else
IF sItemCode = ""GR4"" THEN
nTabIndex = 7
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""), %FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 8
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""), %FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 9
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Gray""""), %FLDR'Redraw(), 'SR', 'CF',"")
nTabIndex = 10
oScript.Execute(""PRINT %_MAINPNL_COLORS$, %FLDR'GetTab("" & nTabIndex & "")'SetTabColor(""""Light Red""""), %FLDR'Redraw(), 'SR', 'CF',"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_1"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_2"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_3"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_4"", ""ENABLE"")
retval = oScript.DebugPrint(""GR4 panel enabled"")
End IF
retVal = myUIObj.SetFolderState(""PNL_CMNEW_1"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_2"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_3"", ""DISABLE"")
retVal = myUIObj.SetFolderState(""PNL_CMNEW_4"", ""DISABLE"")
retval = oScript.DebugPrint(""NO panels enabled"")
End IF
End If
End If
retval = oScript.DebugPrint(""End PR_EnableGR_Panels script"")