> For the complete documentation index, see [llms.txt](https://docs.realmacsoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmacsoftware.com/squash/quick-guide/variables.md).

# Variables

Reuse your own named values in filenames, folders, watermarks and metadata

A variable is a name and a value you set once, such as `Client` and `Acme`, then use wherever you name files or add text. Change the value in one place and your next export uses it, in every preset.

![The Variables tab in Squash Settings, with a Custom Variables list of names and values, add and remove buttons, and a note that variables are saved on this Mac](https://1309898043-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9hJwt9oZ5CYj9I9YIUa9%2Fuploads%2Fgit-blob-95df2142821fcc495bfbaefbc1ca3ccc1fe17bda%2Fsettings-variables.png?alt=media)

You can use variables in:

* [Rename](/squash/quick-guide/nodes/rename.md) templates
* the **Subfolder** field and custom subfolder names in [Export](/squash/quick-guide/nodes/export.md#subfolders)
* the **Text** of a [text watermark](/squash/quick-guide/nodes/watermark.md#text-watermarks)
* **Creator**, **Copyright**, **Website** and **Keywords** in [Metadata](/squash/quick-guide/nodes/metadata.md#adding-your-own-metadata)

### Creating a variable

{% stepper %}
{% step %}

### Open the list

Choose **Settings → Variables** and find the **Custom Variables** list, or click the **+** in any of the fields above and choose **Edit Variables…**, which opens **Settings → Variables** for you.
{% endstep %}

{% step %}

### Add a variable

Click **+** below the list, then type a **Name** and a **Value**.
{% endstep %}

{% step %}

### Use it

Click the **+** in a field and choose the variable from the **Variables** section. It's added at the cursor as a chip.
{% endstep %}
{% endstepper %}

You can also type a variable as `{{var:Client}}`. It becomes a chip when you type the closing braces.

A variable's chip has an outline, so you can tell it from Squash's own tokens, which are filled.

### Names

A name can be up to 40 characters and can't include `{`, `}`, `:` or `/`. Two variables can't share a name, and capitals don't make them different: `Client` and `client` count as the same name.

### Changing and deleting

**Changing a value** applies from the next export. Each export uses the values from when it started, so changing one during an export doesn't affect that export.

**Renaming a variable** also updates everywhere it's used, in your current settings and in every saved preset.

**Deleting a variable** asks you to confirm and says how many presets use it. Its chips stay where they are and turn red, with the tooltip "Missing variable". A deleted variable adds nothing to names or text. If you add a variable with the same name again, those chips work again.

{% hint style="info" %}
Variables are saved on your Mac and shared by all your presets. They aren't stored inside presets, so a preset that uses one needs the same variable on any other Mac.
{% endhint %}

### Empty values

A variable with no value, or one that's been deleted, adds nothing:

* In a filename, the text around it stays: `photo-{{var:Client}}` becomes `photo-`.
* In a folder path, that folder is skipped: `{{var:Client}}/web` becomes `web`.
* A text watermark with nothing left to show isn't drawn.
* A metadata field with nothing left is not written.

### Slashes in values

A value can't create folders. In file and folder names, `/`, `:` and `\` in a value become `-`, so `Acme/Web` gives a folder or filename containing `Acme-Web`. To nest folders, type the `/` in the field itself: `{{var:Client}}/{{var:Project}}`.

In watermarks and metadata, the value is used exactly as you typed it. In **Keywords**, commas in a value separate keywords, so a value of `red, blue` adds two.

### Watched Folders and Shortcuts

[Watched Folders](/squash/quick-guide/watched-folders.md) and [Shortcuts](/squash/quick-guide/shortcuts.md) actions use your saved variables in filenames, watermarks and metadata, but with these limits:

* Neither uses the **Subfolder** field. Watched Folders have their own [save options](/squash/quick-guide/watched-folders.md).
* The **Preset** token is empty in both.
* In Shortcuts, the **Folder** token is empty too.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmacsoftware.com/squash/quick-guide/variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
