Suggested Script and Tip

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
sailor dude
Pro Scripter
Posts: 50
Joined: Fri Jan 20, 2006 10:43 pm

Suggested Script and Tip

Post by sailor dude » Fri Dec 15, 2006 7:14 pm

For years, I have struggled to cleanly determine when Internet Explorer. other browser, or other program is finished loading a page or completed a task.

I generally do not need a bullet proof solution. Use VBScript if you need a more robust solution. But, VBScript takes more advanced skills to code.

I have tried using delays, change of window title, window pixel colors, mouse change, VBScript, etc... All these solutions are too inconsistent.

I finally found a nice clean solution using GetControlText. However, you have to know what window will be displayed. This is usually true for me.

Use View System Windows in Macro Scheduler to determine the control to use. This script has been tested with IE6.0, WinXP SP2, MS8.1

Code: Select all

Let>RP_WINDOWMODE=3

CapsOff

Run Program>C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.mjtnet.com/

Let>WEB_PAGE_TITLE=Windows Scripting, Windows Macro Automation, Windows Macro Recorder - Automate your PC for Wind - Microsoft Internet Explorer*

Let>TIMEOUT=30
Let>K=0
Repeat>K
	Wait>0.5
	GetControlText>WEB_PAGE_TITLE,msctls_statusbar32,1,RESULT
	Message>RESULT
	If>RESULT=Done
		Let>K=TIMEOUT-1
	EndIF
	Let>K=K+1
Until>K,TIMEOUT

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts