Skip to main content
Inspiring
November 26, 2023
Answered

Audition Extendscript to Waveform Timeline selection

  • November 26, 2023
  • 1 reply
  • 534 views

Hi All,

 

I'm trying to build an automation in Adobe Audition to make a selection and apply an effect, in this case Silence, to that selection, and then do this for all the other selections.

 

My "Selection" is defined as marker regions (marker with start and end points).

 

The problem I have is that I can't seem to find a function to actually make a selection.

I know that I can move the playhead position by manipulating a variable in the Extendscript, but I want a selection to be activated and the region from start to end position to be selected.

 

Or if there an alternative to turning marker region to a selection.

 

I tried dispatching (DocumentEvent.EVENT_TIMESELECTIONCHANGED), but it didn't work. 

This topic has been closed for replies.
Correct answer MrPingPong

For anyone reading this, I was able to achieve this via the script below.

 

The script goes through each marker and sets the in and out points of the selection and then applies silence.

 

var markerList=app.documents[0].markers
alert(String(markerList.length))
for(i=0;i<(markerList.length);i++){

    var startPos=markerList[i].start
    var endPos=startPos+markerList[i].length
    app.documents[0].playheadPosition=startPos
    app.invokeCommand(String(Application.COMMAND_EDIT_SETINPOINTTOCTI))
    app.documents[0].playheadPosition=endPos
    app.invokeCommand(String(Application.COMMAND_EDIT_SETOUTPOINTTOCTI))
    app.invokeCommand(String(Application.COMMAND_EFFECTS_SILENCE))
    app.invokeCommand(String(Application.COMMAND_EDIT_DESELECTALL))

    
    
    }

1 reply

MrPingPongAuthorCorrect answer
Inspiring
November 26, 2023

For anyone reading this, I was able to achieve this via the script below.

 

The script goes through each marker and sets the in and out points of the selection and then applies silence.

 

var markerList=app.documents[0].markers
alert(String(markerList.length))
for(i=0;i<(markerList.length);i++){

    var startPos=markerList[i].start
    var endPos=startPos+markerList[i].length
    app.documents[0].playheadPosition=startPos
    app.invokeCommand(String(Application.COMMAND_EDIT_SETINPOINTTOCTI))
    app.documents[0].playheadPosition=endPos
    app.invokeCommand(String(Application.COMMAND_EDIT_SETOUTPOINTTOCTI))
    app.invokeCommand(String(Application.COMMAND_EFFECTS_SILENCE))
    app.invokeCommand(String(Application.COMMAND_EDIT_DESELECTALL))

    
    
    }