Jump to content

Hisma

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by Hisma

  1. Hello, I'm trying to figure out how to open a menu item in a program that has a non-traditional menu structure. I had the script working in an old version of the software like this - WinMenuSelectItem($handle, "", "&FILE", "Save As...") Which obviously did a simple file -> save as. But the program has since been updated by the vendor, and now menu is custom-built. Using the simply spy tool, when I highlight the "save as" menu item and press CTRL + W, I get this output (standard code flexible) - ;~ *** Standard code Flexible*** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP2=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Logix Designer - HP_RCS_VSC in HP_VSC.ACD [1756-L82ES 31.11];controltype:=UIA_WindowControlTypeId;class:=Afx:00400000:8:00010003:00000000:019F1155", $treescope_children) _UIA_Action($oP2,"setfocus") Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=File;controltype:=UIA_MenuControlTypeId;class:=Afx:00400000:800:00010003:00000010:00000000", $treescope_children) _UIA_Action($oP1,"setfocus") Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=FILE;controltype:=UIA_ToolBarControlTypeId;class:=BCGPToolBar:400000:8:10003:10", $treescope_children) _UIA_Action($oP0,"setfocus") ;~ First find the object in the parent before you can do something ;~$oUIElement=_UIA_getObjectByFindAll("SaveAs....mainwindow", "title:=Save As...;ControlType:=UIA_MenuItemControlTypeId", $treescope_subtree) Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Save As...;ControlType:=UIA_MenuItemControlTypeId", $treescope_subtree) ;~_UIA_action($oUIElement,"highlight") _UIA_action($oUIElement,"click") As you can see, it's qutie large, and I can't figure out how to clean up that output to make it usable in my script. Can someone help me please?
×
×
  • Create New...