-- Set the full document as a region local fulldocregion = finale.FCMusicRegion() fulldocregion:SetFullDocument() -- Get the selected region local region = finenv.Region() -- Loop through all staves in the full document for slot = fulldocregion.StartSlot, fulldocregion.EndSlot do -- Convert from slot number to staff number/ID local staffnumber = region:CalcStaffNumber(slot) -- Load staff object local staff = finale.FCStaff() staff:Load(staffnumber) -- Create a FCInstrumentPlaybackData object for the staff local playbackdata = staff:CreateInstrumentPlaybackData() -- Go through all 4 layers and process the note layer for layer = 1, 4 do local layerdef = playbackdata:GetNoteLayerData(layer) -- Mute in region, play outside region layerdef.Play = not region:IsStaffIncluded(staffnumber) end -- Save the playback settings playbackdata:Save() end