Skip to content

Configuring script buttons in the AdminClient

The procedure for configuring a script button is shown step by step as an example. The prerequisite is that Scripting is activated.

To do this, proceed as follows:

Activating the script

The prerequisite for this sub-step is at least one script with the name ScriptButton1 in the format_.bat or_.exe (e.g. ScriptButton1.bat or ScriptButton1.exe).

  1. Open the Script management module in the AdminClient.
  2. In the Local files area, navigate to one of the files ScriptButton1.bat or ScriptButton1.exe and copy it to Server scripting directory for automatic update of client.
  3. Click on the Preview button under the Home tab in the Button scripts group to display the Preview dialog.
  4. Click on the button in the Preview dialog to display the Test dialog.
  5. The text Button 1 pressed is displayed in the Test field.
  6. Confirm with OK and close the preview.
  7. Now click on the Apply button to activate the script.

Now open the UserClient and click on the Extras tab. In the menu bar on the far right, the Script1 button is displayed under the Scripting application. Test the script by clicking on the button. The message Executing the script is displayed and the script is executed once.

Configuring the icon

An image file with the name ScriptButton1 in PNG, BMP or JPG format (e.g. ScriptButton1.png) is required for this sub-step.

  1. Open the Script management module in the AdminClient.
  2. Copy the image file to the Server scripting directory for automatic update of client to use this file as the icon for the button.
  3. Click on the Preview button under the Home tab in the Button scripts group to display the Preview dialog.
  4. The copied image is displayed in the Preview dialog.
  5. Use the Apply button to load the image into the Server scripting directory tab. It can then be used in the UserClient.

Switch to the UserClient and click on the button Update from server under Extras. The icon/image is displayed for the ScriptButton1.

Configuring a label and a tooltip

The prerequisite for this sub-step is an initialization file ScriptButton1.ini with the following entries in the section [ButtonProperties]:

Key I/O Description
Text I Label of the button
Tooltip I Tooltip of the button in the GUI
Text_<Language> I Translation of the label of the button in the GUI (_DE / _EN ..)
Tooltip_<Language> I Translation of the tooltip of the button in the GUI (_DE / _EN ...)
  1. Open the Script management module in the AdminClient.
  2. Copy the ScriptButton1.ini file to Server scripting directory for automatic update of client for automatic client update.
  3. Click on Apply to load the INI file into Server scripting directory for automatic update of client.

Switch to the UserClient, click on the Update from server button and check your German and English names and tooltips. You will see the English text if you change the language to English under Extras and the UserClient has been restarted.

Specifying that the script is to be executed component-dependently

  1. In the ScriptButton.ini file under [ButtonProperties], add the line ComponentSpecific=Y.
  2. Carry out steps 5 - 8 in the AdminClient in the Script management module.

Switch to the UserClient and click on the Update from server button. Select at least one component and click on the script button. The message The script "%1" will be run for %2 components is displayed.

Example for the INI file ScriptButton1.ini

[ButtonProperties]
Text=S7 trigger
Tooltip="This button starts S7 upload job"
Text_en="S7 Start"
Tooltip_en="This button starts the S7 Upload job"
ComponentSpecific=Y