Page tree
Skip to end of metadata
Go to start of metadata

insertLayer(layer, position)

Description

Available in: Controller.

Arguments

layerThe Layer object of the layer that you want to insert.Layer
positionThe position where the layer is to bei inserted.number

Example

To explore the following script:

  1. Download Program.vstpreset.
  2. Drag the preset on the MediaBay to import it to the user folder for VST presets.
  3. Create an empty program and add a script module.
  4. Paste the script into the text editor of the script module and execute the script.

 

-- insert layer from Program.vstpreset into the current program
  
-- get the file path for user VST presets
path = getUserPresetPath()
  
-- load VST preset
loadedProgram = loadPreset(path.."/Program/Program.vstpreset")
  
-- get the first layer from the loaded program
layer = loadedProgram:getLayer ()
  
-- insert layer
if layer then
    this.program:insertLayer(layer, 1)
end

1 Comment