OK,i got that out.this is the code i wrote.
//USEUNIT LoadProject
function ResetProject()
{
var FusionDesktop, Window, MainMenu, Submenu, Item;
// Obtains the Windows Notepad main menu
FusionDesktop = Sys["Process"]("FusionDesktop");
Window = Aliases["FusionDesktop"]["HwndSource_MainWindow"] // FusionDesktop["HwndSource_MainWindow"]["MainWindow"]["Grid"]["TabControl"]["Grid"]["DockPanel"];
MainMenu = Window["MainWindow"]["Grid"]["TabControl"]["Grid"]["DockPanel"]["Menu"]["WPFMenu"]
// Obtains the View submenu
Submenu = MainMenu["Items"]("File")["SubMenu"]
// Obtains the "Status Bar" menu item
Item = Submenu["Items"]("Reset project");
// Checks whether the item is enabled
if (Item["Enabled"])
Log["Message"]("The Status Bar menu item is enabled");
else
Log["Message"]("The Status Bar menu item is disabled");
but,now the bold line failed to get the correct value of Enabled.
when adding watch to the Item object i can see that its Enabled value is True but, when using the object spy to pint the same object its Enabled value is false TC is not consistent.i've tried to refresh the Watch list by checking and unchecking the Item object but the Enabled value was still True which is not true.
why is that happening?
thanks