0
Mute layer via Script
New Here
,
/t5/after-effects-discussions/mute-layer-via-script/td-p/13510569
Jan 22, 2023
Jan 22, 2023
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.
TOPICS
Audio
,
How to
,
Scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/after-effects-discussions/mute-layer-via-script/m-p/13510718#M222015
Jan 22, 2023
Jan 22, 2023
Copy link to clipboard
Copied
Like this:
var myLayer = app.project.activeItem.layer(1);
if (myLayer.hasAudio) myLayer.audioEnabled = false;
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
SMPTN
AUTHOR
New Here
,
/t5/after-effects-discussions/mute-layer-via-script/m-p/13510727#M222017
Jan 22, 2023
Jan 22, 2023
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/after-effects-discussions/mute-layer-via-script/m-p/13510745#M222019
Jan 22, 2023
Jan 22, 2023
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;
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

