KB-127114: Configuring scripting buttons in AdminClient

Configuring scripting buttons in AdminClient

This section details the processes involved in configuring a script button.

Scripting needs to be activated.

To do this, proceed as follows:

Activate scripting

You will require at least one script with the name ScriptButton1. This script needs to be in either_.bat or_.exe (for example, ScriptButton1.bat or ScriptButton1.exe).

  1. Go to Script management module in the AdminClient.
  2. Go to Local files and then to theScriptButton1.bat(or theScriptButton1.exe). Copy this file into the Server scripting directory for automatic update of client
  3. Click on Preview. You can find this button by going to Home > Button scripts and then clicking on Preview
  4. Click on Preview and the Test dialog will be displayed
  5. In Test dialog, go to the Test field. In this field, the text Button %1 clicked is displayed
  6. Confirm changes by clicking on OK and close the preview.
  7. Click on Apply to activate the script.

Go to the UserClient and click on Extras. In the far right corner of the menu bar, the Script 1 button will be displayed under the function Scripts. Test the script by clicking on the button. The dialog Running script 1 will be displayed and the script will be executed once.

Configure icon

You will require an image file with the name ScriptButton1. This file needs to be PNG, BMP or JPG (for example, ScriptButton1.png).

  1. Go to Script management in the AdminClient.
  2. To use this file as an icon for the button, copy the image file into the Server scripting directory for automatic update of client.
  3. Click on Preview. You can find this button by going to Home > Button scripts and then clicking on Preview.
  4. The copied image will be displayed in the dialog Preview for the Script 1 button.
  5. Click Apply to load the image to the Server scripting directory. By doing this, the button can be used in the UserClient.

Go to UserClient and in Extras click on Update from server. The symbol/image will be displayed for Script1.

Configuring labels and tooltips

You will require an initialization file (ScriptButton1.ini) with the following entries in the section [ButtonProperties]:

INI key I/O Description

Text I Button label

Tooltip I

Tooltip of the button in the GUI

Text _<Language>I

Translation of button labels in the GUI (_DE / _EN …)

Tooltip _<Language>I

Translation of button tooltip in the GUI (_DE / _EN …)

  1. Go to Script management in the AdminClient
  2. Copy theScriptButton1.inifile into the Server scripting directory for automatic update of client.
  3. Click on Apply to load the INI file into Server scripting directory for automatic update of client

Switch to the UserClient, click on Update from server and check the German and English names and tooltips. To see the English text, go to Extras and change the language to English and then restart the UserClient.

Determine that you want to execute the script so that it’s component dependent

  1. In theScriptButton.ini, under [ButtonProperties], insert the line ComponentSpecific=Y
  2. Carry out steps 5. – 8. in the Script management module of the AdminClient

Return to the UserClient and click on Update from server. Select at least one component and click on the scripting button. The dialog Script (name of button) is executed for n components is displayed.

Example of the INI file ScriptButton1.ini

[ButtonProperties]Text=S7-UploadTooltip="This button starts S7 upload job"Text_de="S7 Start"Tooltip_de="Dieser Button startet den S7 Upload-Job"ComponentSpecific=Y

Last update: September 15, 2023

Related Articles

IMPRINT | PRIVACY POLICY | COOKIE POLICY

Privacy Preference Center