Carlo84 Posted October 8, 2010 Share Posted October 8, 2010 Hey all, 1st of all i running Vista x64secondly:From the helpfile:; This will select File, Page Setup in notepad WinMenuSelectItem("[CLASS:Notepad] ", "", "&File", "Page Set&up..." )This does not work...either way i got my function to work but it has strange conditions and i need a solution for them.For SketchUp 6 Pro my code is this:$i = WinMenuSelectItem("Untitled - SketchUp Pro", "", "&File", "&Export", "3D Model...") Exit($i)Scenario #1.I open SketchUp, i run the script nothing will happen..Scenario #2.I open SketchUp, i unfold the menu and select, File > Export and close the menu again..From this point on my script will always workIt is as if the menu's items either change name after i open the menu or they simply do not exist till i open them menu?Same thing with Notepad too and the Autoit example.Is there anyway to fix this? _SplashProgressImage | _Regionselector | _IsPressed360 | _UserAccountContol_SetLevel | _ListSubFolders Link to comment Share on other sites More sharing options...
Carlo84 Posted October 8, 2010 Author Share Posted October 8, 2010 (edited) typical, to find the answer right after i made a topic They do indeed change, this fixed it though #include <GuiMenu.au3> $hWnd = WinGetHandle("Untitled - SketchUp Pro") $hMain = _GUICtrlMenu_GetMenu($hWnd) $hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0) $hExport = _GUICtrlMenu_GetItemID($hFile, 10) $file = _GUICtrlMenu_GetItemText($hMain, 0) $export = _GUICtrlMenu_GetItemText($hFile, 10) $Model = _GUICtrlMenu_GetItemText($hExport, 0) WinMenuSelectItem($hWnd, "", $file, $export, $Model) Writing it to console showed it changed. WinMenuSelectItem("Untitled - SketchUp Pro", "", "&File", "&Export", "&3D Model...") WinMenuSelectItem("Untitled - SketchUp Pro", "", "&File", "&Export", "3D Model...") Edited October 8, 2010 by Djarlo _SplashProgressImage | _Regionselector | _IsPressed360 | _UserAccountContol_SetLevel | _ListSubFolders Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now