---
title: "scriptExists"
canonical: "https://help.vicon.com/space/Shogun16/13340323/scriptExists"
format: markdown
---
# Description

This command enables you to query Shogun Post's internal list of scripts to see whether a particular script exists. This may be useful if you are trying to construct a set of smart scripts which call other scripts based on their existence.

Calling a script which does not exist will cause the calling script to fail, which is almost always undesirable.

This command is largely superseded by the [runScript](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13340290) command.

## Functional area

System

# Command syntax

## Syntax

|  |
| --- |
| `scriptExists "scriptName"` |

### Arguments

> Macro (scroll-tablelayout)

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `scriptName` | string | yes | Name of the script to look for. The script name is the portion of the script file's file name excluding the extension (e.g. CutKeysSmart.hsl would have a name of CutKeysSmart). |

### Flags

None

## Return value

boolean

Returns true if a script with the given name exists in Shogun Post's internal list of scripts. 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// See if the CutKeysBigRanges script exists in our script directories. 
//If not don't call the script that relies on it.
if( `scriptExists "CutKeysBigRanges` == true )
{ 
     ScriptThatCallsCutKeysBigRanges;
}
```

# Additional information

## Related commands

- [runScript](https://vicon-help.atlassian.net/wiki/spaces/Shogun16/pages/13340290)