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
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.
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).
Right click on the new button, and from the popup pane select “Edit Animations” (see Figure 3 below).
Click the plus symbol to create a new animation and select “Action Scripts” (see Figure 4 below).
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:
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.