ToyBoi Posted August 13, 2008 Share Posted August 13, 2008 I know there's winwait for windows, say if u open notepad it would wait for it to be active what about if i do Alt & f and I select from the menu If someone has a slow computer the script would cause a lot of bugs, and I don't want to use sleep b/c it's always a guesstimate , is there a way for autoit to send a command and wait for it to be completed and then do the next code so eg if i want to save a file i would do send("!f") wait till done send("a") ... .. Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 13, 2008 Share Posted August 13, 2008 I know there's winwait for windows, say if u open notepad it would wait for it to be activewhat about if i do Alt & f and I select from the menuIf someone has a slow computer the script would cause a lot of bugs, and I don't want to use sleep b/c it's always a guesstimate , is there a way for autoit to send a command and wait for it to be completed and then do the next codeso eg if i want to save a file i would dosend("!f")wait till donesend("a")Use WinMenuSelectItem (), _GuiCtrlMenu_*, or _GuiCtrlToolbar_* functions instead. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ToyBoi Posted August 13, 2008 Author Share Posted August 13, 2008 Use WinMenuSelectItem (), _GuiCtrlMenu_*, or _GuiCtrlToolbar_* functions instead. Thank you, i will try that out Link to comment Share on other sites More sharing options...
ToyBoi Posted August 14, 2008 Author Share Posted August 14, 2008 Thank you, i will try that out Hi I tried the following and excel wasn't able to select the right menu, is there something wrong with it? #include <GuiConstants.au3> #include <IE.au3> #include <File.au3> #include <ExcelCOM_UDF.au3> #include <Array.au3> #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <Constants.au3> $oExcel = _ExcelBookNew(1) WinWaitActive($oExcel) WinMenuSelectItem("Microsoft Excel-Book1 ", "", "&Tools", "&Macro","&Record New Macro..." ) Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 14, 2008 Share Posted August 14, 2008 Hi I tried the following and excel wasn't able to select the right menu, is there something wrong with it? #include <GuiConstants.au3> #include <IE.au3> #include <File.au3> #include <ExcelCOM_UDF.au3> #include <Array.au3> #include <GUIComboBox.au3> #include <GuiConstantsEx.au3> #include <Constants.au3> $oExcel = _ExcelBookNew(1) WinWaitActive($oExcel) WinMenuSelectItem("Microsoft Excel-Book1 ", "", "&Tools", "&Macro","&Record New Macro..." ) From the help file remarks under WinMenuSelectItem(): WinMenuSelectItem will only work on standard menus. Unfortunately, many menus in use today are actually custom written or toolbars "pretending" to be menus. This is true for most Microsoft applications. In MS Excel, the menu is Class "MsoCommandBar". So I wouldn't be surprised if that didn't work. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ToyBoi Posted August 15, 2008 Author Share Posted August 15, 2008 From the help file remarks under WinMenuSelectItem(): In MS Excel, the menu is Class "MsoCommandBar". So I wouldn't be surprised if that didn't work. So in this situation is this doable? Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 15, 2008 Share Posted August 15, 2008 So in this situation is this doable?Have you tried the _GuiCtrlToolbar_* functions on it yet? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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