I'm experiencing an issue with IETagEvent and have a question about IETagEventbyAttrib.
The code below loops through a list of items that has a Tag that deletes items from a list and repeats that delete for a number of vehicles on the list. We set this up originally as a mouse function, but it was having an error every now and then, and the IETagEvent works every time (so far anyway).
The routine that deletes the line has a "message from website" confirmation box that occurs on the first line(only) to confirm that it is okay to delete this first line.
When we utilized the mouse technique, we could issue the UIClick method to click the OK button on this message, and the routine would proceed just fine.
The issue is that the IETagEvent does not time out (or there is some timing parameter I am unaware of) when the confirmation box appears, and the program basically "hangs" forever, so we cannot simply click the OK button in the box. I really could use some guidance as to how to have the IETagEvent time out or a work around for this.
Also, the IETagEventbyAttrib command: could I get an example as to how to use an INDEX with this command. It says we can use an INDEX in the help, but there are no examples that show how this works and I have spent many hours trying the various combinations without success.
Let>k=0
While>k<%HistVehicles%
//DelIdx is always the same and is calculated with the IEGetTagsby command before this section of Code
IETagEvent>{"https://www.centraldispatch.com/protect ... lIdx,click,
// Check for window to verify delete line //
UIClick>{"Message from webpage"},{"OK"}
Wait>.25
let>k=k+1
EndWhile
Thanks,
Steve
rsvot
Newbie
Posts: 1
Joined: 28 Apr 2016 11:21 pm
Top
Issue with IETagEvent
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: Issue with IETagEvent
This is because the IE API is synchronous and the dialog is being generated by the click method itself - possibly via javascript that the click event calls - and so the click event does not return until after the dialog has been cleared. Therefore the script will wait forever until someone or something else clicks the dialog. There's nothing we can do about that as there's no asynchronous version.
One option is to create a second script which does nothing but watches for this dialog and clicks it when it sees it. It then loops back and keeps watching. Have your main script execute this compiled script at the start or prior to the IETagEvent. As this second script is now running as a separate process it will be able to see the dialog and close it, allowing the main script to continue.
One option is to create a second script which does nothing but watches for this dialog and clicks it when it sees it. It then loops back and keeps watching. Have your main script execute this compiled script at the start or prior to the IETagEvent. As this second script is now running as a separate process it will be able to see the dialog and close it, allowing the main script to continue.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?