<script>
    function awrGetPortNumber() {
        var port = localStorage.getItem('awr_port_number');
        if (!port) {
            port = "8080";
        }
        console.log('awr_port_number');
        return port;
    }
    function awrSetPortNumber(port) {
        localStorage.setItem('awr_port_number', port);
        console.log('set port number to: ' + port);

    }
</script>

Requirements

Active Content only works in AWRDE version 13.0 and above. 

Troubleshooting

Here are some things to check if you are having trouble getting Active Content to work:

  1. Force an update of cached files. This is typically Ctrl + F5.   Recent changes (October 2020) will require new code to make active content to work. 
  2. By default Active Content uses listens on TCP port 8080.  If you have any other software listening on this port the active content server will not be able to starts.  If you already know this is the case, go to Setting the Active Content Port, below.  
    To test for this:
    1. Make sure only one copy of AWRDE is running
    2. Make sure Guided Help is enabled from the Help > Enable Guided Help.  The icon in the menu will show "light up" when it is enabled.   
    3. Open the Web Browser
    4. In the address bar type:     (with 8080 replaced with the port number set in MWO if you have changed it)
      1. If you get a page that says "You are now connected MWOffice and can load your Guided Help page" proceed to step 2.
      2. If you get the error message "This page can’t be displayed" then the Active Content server was not able to start.  Proceed to step 3.
  3. Click the button below:

    <input type="button" class="gh-button indent" value="Test Guided Help" onclick="jscript:runAwrScript('awrGh_Check');" />


    1. If a dialog box opens saying guided help is connected, guided help is working.
    2. If a dialog box opens with suggestions about how to make guided help work, Proceed to step 3.  
    3. if no dialog opens, contact Getting AWR Technical Support for additional help.
  4. The browser is not able to connect to the guided help server.  Open the TaskManager and verify that the process ScriptingEnv.exe is running
    1. If ScriptingEnv.exe is running please contact AWR for additional help.
    2. If ScriptingEnv.exe is not running, it is possible you have a port conflict.  Proceed to step 4.
  5. Can't connect to the address entered in step2 It is possible that you have other software using the 8080 port which is preventing ScriptingEnv from starting up.  To test for this you need to open an Administrator Command Prompt.  Then from a command line you can run: netstat -abno.  Then in the output look for the text shown below which indicates that the port is being used.  The line below it shows what program is using the port. If the port is being used you will need to change the Active Content port to get things to work.   You are focusing on the port that is listening.  Below it shows ScriptingEvn.exe which would work but if some other application is using the port, then it needs to change.  


Setting the Active Content Port

Setting the port involves setting an unused port in both AWRDE and in your browser.  You should look for an unused port out of the following: 8080, 8081, … 8089.   If you use a port in this range the website will search all the ports in this range.  Otherwise, you will also need to use the setting below to change the port number for which the website is using to connect.  

Note: Browser history/cache must be enabled to use non-default ports.


Set the port in AWRDE

  1. In AWRDE, go to Scripts > Configuration> Change_Port_Number
  2. Enter the port in the dialog and press OK
  3. Restart AWRDE

Set the port in your browser

The port is searched over various ports.   See the bugging section below to see messages about what happened with the ports.   You may at any time overwrite the ports to use using the page below.   


<hr>
<p><b>Debugging Messages</b></p>
<p id="ghPortSearch"></p>
<p>Your port number is currently set to: <span id="current-port-number">nnnn</span></p>
<p><strong>Enter your desired port number here: </strong>
           <input id="desired-port-number" type="text" name="port_number" placeholder="8080" />
           <button onclick="setPortNumber();">Click to set port</button>
</p>

<script>

var currentPort = awrGetPortNumber();
obj = document.getElementById('current-port-number');
obj.innerText = currentPort;

function setPortNumber() {
            var obj = document.getElementById('desired-port-number')
            var port = obj.value;
            console.log('user set port to: ' + port);
            awrSetPortNumber(port);
            obj = document.getElementById('current-port-number');
            obj.innerText = port; 
}
 
</script>