Copy link to clipboard
Copied
Hello guys!
How can i mute/unmute layer "track" via script? I mean turn off/on the little speaker button.
Thanks.
Copy link to clipboard
Copied
Like this:
var myLayer = app.project.activeItem.layer(1);
if (myLayer.hasAudio) myLayer.audioEnabled = false;
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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;