Skip to main content
Participant
January 22, 2023
Question

Mute layer via Script

  • January 22, 2023
  • 1 reply
  • 458 views

Hello guys!

How can i mute/unmute layer "track" via script? I mean turn off/on the little speaker button.

 

Thanks.

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
January 22, 2023

Like this:

var myLayer = app.project.activeItem.layer(1);
if (myLayer.hasAudio) myLayer.audioEnabled = false;
SMPTNAuthor
Participant
January 22, 2023

For some reason it says Track is undefined. I did change 

var myLayer = app.project.activeItem.layer(1);

to

var myLayer = app.project.activeItem.layer('1');

and this works.

Thanks Dan.

Dan Ebberts
Community Expert
Community Expert
January 22, 2023

I missed the 'track' part of your question. It should have been:

var myLayer = app.project.activeItem.layer("track");
if (myLayer.hasAudio) myLayer.audioEnabled = false;