Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Mute layer via Script

New Here ,
Jan 22, 2023 Jan 22, 2023

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
315
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 22, 2023 Jan 22, 2023

Like this:

var myLayer = app.project.activeItem.layer(1);
if (myLayer.hasAudio) myLayer.audioEnabled = false;
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2023 Jan 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 22, 2023 Jan 22, 2023
LATEST

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;
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines