Jump to content

winwait


 Share

Recommended Posts

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

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")

Use WinMenuSelectItem (), _GuiCtrlMenu_*, or _GuiCtrlToolbar_* functions instead.

:P

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

Thank you, i will try that out :P

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

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.

:P

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...