---
title: "HSL scripting with Vicon Shogun Post"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737092/HSL%20scripting%20with%20Vicon%20Shogun%20Post"
format: markdown
---
> Macro (scroll-ignore)
> 
> ![Vicon Shogun Post banner](media://978e69c2-07e4-4e5b-b79b-530b74288dd5)

## About this guide

This guide explains the HSL scripting that is available with Shogun Post, introduces you to the script interface components, and teaches you the basic structure and tools you need to use scripts and to tailor them to your requirements.

Before you create scripts, ensure that you feel comfortable using Shogun Live and Post to capture, edit, and export data.

Note the following points:

- Almost all operations you perform manually in Shogun can be repeated using scripts.
- Shogun HSL scripts are based on the HOM Script Language (HSL).
- For information about Python scripting functionality, see [Python scripting with Vicon Shogun Post](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736582).

### Creating scripts

Most HSL scripts are created using the Shogun Post **Script Editor**.

- The easiest way to create an HSL script is to open the **Script Editor** (see [Open the Script Editor](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736677)), select Record Actions > Macro (inline-media-image)

, then perform one or more actions in Shogun. When you are done you can select Record Actions again to stop recording. When the steps are recorded, you can execute them by selecting Run Script > Macro (inline-media-image)

, or customize them to create a more full-featured script.
  - The **Script Editor** features tools for editing scripts, debugging scripts, saving scripts and loading previously saved scripts. For more information, see [Use the Shogun Post Script Editor](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736677).
- You can use any ASCII text editor to create scripts as long as that editor uses only standard ASCII characters. Note that although you can create ASCII files with Microsoft® Word and WordPad, they frequently insert non-standard characters like em-dashes and "curly" quotes, which Shogun cannot read.
- Sometimes you want to create scripts that prompt the user for information. You can do this in the following ways:
  - Create a user window that collects information which is subsequently passed to a script (see [Create user windows to run HSL scripts](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737722)).
  - Create a pipeline operation. A pipeline operation is just a script with extra statements that ask the user to provide information prior to execution. You can string together multiple pipeline operations to create very sophisticated routines.

> ✅ **Tip**   
> ✅ Remember that Shogun Post comes with example HSL scripts that you can use to modify and manipulate motion capture data. You can find these sample scripts in the *C:\Program Files\Vicon\ShogunPost#.#\Scripts* folder. Sometimes the easiest way to create a script is simply to duplicate and modify one of the existing scripts.

> Macro (scroll-pagebreak)

### Running scripts

You can execute HSL and Python commands in the command line on the status bar at the bottom of the Shogun Post window. This is handy when you just want to execute one or two commands and don't want to open a panel. For more information, see [Run scripts from the command line](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736935).

After you've created a script, you can create a hot key for it, add it to the **Marking** menu, or put it on the ribbon.

### Reviewing executed scripts

The **Log** displays a list of all the commands you have executed in the current session. To display the **Log**, either:

- On the status bar, select the Log button.
- On the **General** menu, select **Log**.

The Log displays a list of previously executed commands. This is useful when you want to see the results of previous commands while writing a script.

You can also use the [print](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737082) command to write the contents of specified strings to the **Log** (see [Print HSL command data to Log](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737023)).

Now that you understand these fundamentals, you can begin creating, using, and allowing others to use your scripts. 

> Macro (scroll-pagebreak)

> Macro (scroll-only)
> 
> ### About Vicon Shogun Post documentation
> 
> The following documentation is available with Shogun Post, both as help pages available online and as PDFs that you can download from [PDF downloads for Vicon Shogun Post](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737490):
> 
> > Macro (scroll-tablelayout)
> 
> | **Document** | **Description** |
> | --- | --- |
> | *What's new in * *Vicon Shogun Post* | Describes new features and other changes in Shogun Post releases, including release notes with full list of addressed issues. |
> | *Installing and licensing Vicon Shogun Post* | Installation and licensing instructions. |
> | *Getting started with Vicon Shogun Post* | Introduction and basic workflow for processing and exporting data with Vicon Shogun Post. |
> | *Getting more from Vicon Shogun Post* | More advanced information to help you to take your use of Shogun Post further. |
> | *HSL scripting with Vicon Shogun Post* | HSL scripting guidelines and commands. |
> | *Python scripting with Vicon Shogun Post* | Basic information on using Python with Shogun Post. |
> 
> For more documentation related to Shogun Post and other Vicon documents, visit [help.vicon.com](https://help.vicon.com/).