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

Mute layer via Script

New Here ,
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

Views

209

Translate

Translate

Report

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

Copy link to clipboard

Copied

Like this:

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

Votes

Translate

Translate

Report

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

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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;

Votes

Translate

Translate

Report

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