Automating Kanzi Studio tasks

You can automate tasks in Kanzi Studio by executing Kanzi Studio commands on the command line interface. For example, use this approach when you want to export kzb files of a large number of Kanzi Studio projects on a build server.

For the list of available commands see Kanzi Studio command reference .

To automate Kanzi Studio tasks:

  1. In a text editor create a script where you define what commands you want Kanzi Studio to run.
    For example, to open a Kanzi Studio project in Kanzi Studio, create a script that contains the LoadProject command followed by the path to the Kanzi Studio project you want to open, and save the script as MyScript.txt.
    LoadProject "C:\KanziWorkspace\Projects\MyProject\Tool_project\MyProject.kzproj"
  2. Open the command line interface in the <KanziInstallation>/Studio/Bin directory and run the KanziStudio.exe file with the /Script flag pointing to the script you created in the previous step.
    For example, on the command line interface run
    KanziStudio.exe /Script="C:\Users\username\Documents\MyScript.txt"

Automating the exporting of kzb files

Use ExportBinary command when you want to export a kzb file from a Kanzi Studio project.

To automate the exporting of kzb files:

  1. In a text editor create a script that opens a project and exports a kzb file.
    # Open the project named MyProject.
    LoadProject "C:\KanziWorkspace\Projects\MyProject\Tool_project\MyProject.kzproj"
    # Export the kzb file to the location set in the Project > Properties in the Binary Export Directory property.
    # To export the kzb file to another location use: ExportBinary "Path\to\directory\MyProjectBinary.kzb"
    ExportBinary
    # Close Kanzi Studio. If you want to continue using Kanzi Studio after the script executes, comment out this line.
    ExitApplication
  2. Open the command line interface in the <KanziInstallation>/Studio/Bin directory and run the KanziStudio.exe file with the script you created in the previous step.
    KanziStudio.exe /Script="C:\Users\username\Documents\MyScript.txt"

See also

Kanzi Studio command reference