Help icon product icon
Translation
Sound Mill - User's Guide
          Go back Back to Table of Contents

Running External Programs

Overview

You can run External Programs and pass variable values to the program ( examples: .bat batch scripts, .exe executable files, etc.. Really any script or executable that you can start from the Windows Start -- Run dialog). External Programs can be run manually from the Sound List window or executed from an automation script in the Automator (including scheduling). The External Program could also be a Macro Recorder program that starts a desired program and simulates manual menu selections or button presses. AutoHotkey is a free, open-source utility that will perform Macro Recorder operations. It can also be document file if the document type is associated with an executable program. For example, if "txt" files are associated to Notepad, you could specify a text document in the Run field (ie Mydoc.txt). When invoked, Notepad would open Mydoc.txt.

There is a two step setup process.

External Programs Editor

Click Tools-- Automation -- External Programs -- Edit, then click the Add button to create a new External Program definition. Now click the Edit button to configure the new definition in the External Programs Editor dialog (see Figure 1). See the "External Programs and Active Window Focus" section below for an overview of the Window Focus items.

Figure 1.  Edit External Program
Figure 1. Edit External Program

How to Run an External Program

First you need to create a new Sound Item that will run the program. From the main application window, go to Edit Sound Item -- Add Run External Program Item. Now, select the Sound Item in the list to fill in the D Descriptors attributes (see Figure 2). Change which External Program to run by clicking the Browse button and then picking the program from the resulting list. The Name field is filled in with the name of the program. Add terms to the Name that describe the action being performed (ex. Dim light, can 1, low, blue).

Figure 2.  Edit External Descriptors
Figure 2. Edit External Descriptors

If you delete an External Program defintion and you have Sound Items that reference it, the Sound Items will become orphaned. The Sound Item ExtProgram field will show "Progam not found". This orphaned condition is also flagged if you run a Tools -- List Validation Check. Then relink the Sound Items using the Browse button (described above). If you have a lot of Sound Items to fix, here's a productivity tip. You can simply add a new External Program definition. In the new definition, type the Id value that the Sound Items are referencing.

How to Pass Parameters/Variables

Optional. Some programs allow you to pass Variables that describe the actions to perform. The Variables are passed to the program when the program is run. Type any values accepted by the External Program in the Variables field of the Sound Item Descriptors (see Figure 2). Multiple values are usually separated by spaces or commas. See the documentation for the program to see what separator it expects. If a value has embedded blanks and does not pass properly, try enclosing the value in double quotes (ex. "D:\Data\My data values.xml").

External Programs in Automation

You can run External Programs in automation scripts in a similar way that sounds are played in automation. Add these automation steps from the Script Editor. You can offset-time these or schedule when to run them.

External Programs and Active Window Focus

When you run an external program, it typically open up its own program window and that window becomes the active (focused) window. In Windows, keyboard keystrokes and mouse clicks are directed to the active window. Soundmill provides a way to automatically return focus to itself after invoking an external program. And allows for a preset amount of time to expire before returning focus so that the external program can complete some work if necessary. This is especially important to Easy Player users who are operating the player with a remote control since the Easy Player window must be the active window to receive button push signals from the remote. See the the External Programs Editor above for details on these settings.