| || |
looping through menu items
I've been trying to check that an [F1] help function works when menuitems are highlighted but I'm having a problem passing the variables to the script.
I'm doing something like this:
[-] testcase menubarplay() appstate none
[ ] List of String MenubarItems
[ ] string MenubarItem
[ ] MenubarItems = Application.MenuBar.GetContents()
[ ] Print(MenubarItems)
[-] for each MenubarItem in MenubarItems
[ ] Application.SetActive()
[ ] Agent.DisplayMessage("",MenubarItem)
[ ] Application.MenubarItem.GetItemCount()
The DisplayMessage returns each individual item in the menu but the last line of this code chokes cause MenubarItem is not defined in my declarations. How do I go about passing the variable MenubarItem to the script?
Re: looping through menu items
To be able to refer to any kind of window by name at runtime in this way, you will need to specify the window type and the tag in the line as you refer to it. I think the code you need is as follows: