Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macro is waiting and not sure why
#1
I am trying to create a macro that will simulate clicking a DELETE button and the OK on the dialog box. Here is the code:

AccClick("Delete" "PUSHBUTTON" "Internet Explorer" "Internet Explorer_Server" "" 0x1001)
AccClick("OK" "PUSHBUTTON" "Internet Explorer" "Button" "" 0x1001)

But when the click button is "pushed" the dialog comes up, but the OK button is never "clicked" the macro is paused until I click on the dialog box. Then I recieve Objevt Not Found error.

How do I get rid of the wait? I have tried other code as well with the same outcome.

TIA!
#2
I don't know why it waits, but the second AccClick probably searches in the main IE window, because it finds Internet Explorer before the dialog appears. Insert a wait command. Or, wait for the dialog, and use dialog handle in the second AccClick.

Code:
Copy      Help
AccClick("Delete" "PUSHBUTTON" "Internet Explorer" "Internet Explorer_Server" "" 0x1001)
1
int iedialog=wait(5 win("Internet Explorer" "#32770"))
AccClick("OK" "PUSHBUTTON" iedialog "Button" "" 0x1001)
#3
Hate to say this, but this code does not work.

AccClick("Delete" "PUSHBUTTON" "Internet Explorer" "Internet Explorer_Server" "" 0x1001)
1
int iedialog=wait(5 win("Internet Explorer" "#32770"))
AccClick("OK" "PUSHBUTTON" iedialog "Button" "" 0x1001)

It is still pausing after the first line and never gets to the 1 wait.

Thanks for the help.
#4
Try Mouse.

Code:
Copy      Help
Acc a=acc("Delete" "PUSHBUTTON" "Internet Explorer" "Internet Explorer_Server" "" 0x1001)
a.Mouse(1)
;...
#5
That took care of it.

Thanks!


Forum Jump:


Users browsing this thread: 1 Guest(s)