Pages: 1
Print
Author Topic: Script Example: Loading web pages in Resource Manager  (Read 736 times)
murray
Global Moderator
Member

Posts: 23


« on: February 25, 2010, 06:31:05 PM »

Some web pages can take a little while to load in the Resource Manager and script running in XMetaL Author cannot do any operations on the web page until it is fully loaded. Therefore we need some way to know when a web page running in the resource manager is fully loaded.

A web page is loaded in the resource manager. When the page finishes loading (the <body> onload event executes), it invokes a macro in XMetaL Author to tell XMetaL the page is fully loaded.

Installation
------------
1) copy the resManTest2.mcr file to the Startup folder in XMetaL Author
2) copy the resManTest2.html file to the Forms folder in XMetaL Author
If running a version of XMetaL Author that is different than 6.0, you will need to edit the resManTest2.mcr file and change the path to the resManTest2.html file that is in the WebPage.navigate() call.

Operation
---------
On startup, the resManTest.mcr file is loaded. It has a macro called "LoadWebPageInResourceManager" that you can launch. The page is loaded in the resource manager. When the page finishes loading, it invokes a macro in XMetaL Author to tell XMetaL the page is fully loaded (which pops up an alert message in this case).

To launch the macro:
- Right click on the tool bar are in XMetaL Author and enable the Macro toolbar.
- Select the LoadWebPageInResourceManager macro from the pulldown list.
- Launch the macro by clicking on the Run Current Macro button (the green triangle to the left of the pulldown list).

* determineIfResManPageIsLoaded.zip (1.99 KB - downloaded 116 times.)
Logged
Pages: 1
Print
Jump to: