Skip to main content
InSource Solutions

TN Appsvr221 Opening External Applications from an ArchestrA Graphic Object

InSource_Logo_Transparent.png

Description

 

This article from InSource shows how to open an external application such as Internet Explorer, Notepad, or the Windows Calculator from an Application Server ArchestrA graphic object.

  • Author: Peter Farrell
  • Published: 02/01/2017
  • Applies to: Industrial Application Server all versions to date

Details

It has always been possible to create a button in an InTouch classic Window which uses an InTouch script function to open an external application such as Internet Explorer, Notepad, or the Windows Calculator.  A popular method has been, and still is, to use the InTouch native StartApp() function to call the external application (see example in Figure 1 below). However, the StartApp() function commonly used to achieve this does not exist within an Application Server Galaxy.  This is an InTouch native script function and it does not migrate to a Galaxy based ArchestrA graphic.

MT_StartExes_001.png
Figure 1

 

Ideally, in a managed application environment, it would be optimal for this functionality to be a part of a Galaxy hosted object which could be deployed and reused from the ArchestrA Graphics Library. One solution is to use the Dot Net scripting capability built into the Application Server Galaxy.

From within the ArchestrA IDE navigate to the ArchestrA Graphics toolbox and create a new symbol.  In this example, a new symbol called “Start_External_App_Button” was created.  Using the Tools pallet of prebuilt objects, the Button object was selected and placed on the symbol editor area (see Figure 2 below).

MT_StartExes_002.png
Figure 2

 

Right click on the new button, and from the popup pane select “Edit Animations” (see Figure 3 below).

MT_StartExes_003.png
Figure 3

 

Click the plus symbol to create a new animation and select “Action Scripts” (see Figure 4 below).

MT_StartExes_004.png
Figure 4

 

In this example, we are using an “On Left Click/Key Down” trigger and the following use of a Dot Net script function in the body of the script as shown in figure 5 below:

System.Diagnostics.Process.Start("iexplore.exe");

Click “OK”

 

MT_StartExes_005.png
Figure 5

 

After saving your new Symbol, you can now embed it into your WindowViewer application and open an external application.  This new symbol is available in your ArchestrA Graphics library and can be reused and deployed as often as you wish. Since this is a Dot Net script, further enhancement of this scripting can expand the capability and flexibility of the object.

 

MT_StartExes_006.png
Figure 6