---
title: "setActiveLayer"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737913/setActiveLayer"
format: markdown
---
# Description

Sets the active layer in the active clip using the name of the layer or a relative position.

An error is generated if there is no clip on the scene.

## Functional area

NLE

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `setActiveLayer "layerName"[-next] [-prev]` |

### Arguments

> Macro (scroll-tablelayout)

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `layerName` | string | yes | The name of layer to make active. Can be skipped if one of the flags `-next` or `-prev` is set. |

### Flags

> Macro (scroll-tablelayout)

| Name | Flag arguments | Argument type | Exclusive to | Comments |
| --- | --- | --- | --- | --- |
| `next` | 0 | — | prev | Set the next layer in the active clip as an active |
| `prev` | 0 | — | next | Set the previous layer in the active clip as an active |

## Return value

void 

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Print the name of the active clip
string $clip = `getActiveClip`;
print $clip;
 
// Add new layers
string $name = "new layer";
addLayer $name;
addLayer $name; 
addLayer $name;
setActiveLayer $name;
setActiveLayer -next;
setActiveLayer -prev;
```

# Additional information

## Related commands

- [addLayer](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737807)
- [addToClip](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737256)
- [copyClip](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253739720)
- [cropClip](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736523)
- [deleteClipData](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736978)
- [flatten](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738158)
- [getActiveLayer](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736484)
- [getClips](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737048)
- [moveClip](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736803)
- [offsetClips](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737528)
- [removeFromClip](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736603)
- [removeLayer](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738515)
- [resetClip](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736672)
- [selectClipObjects](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253739060)
- [tileClips](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253738014)