track = reaper.GetMasterTrack(0)
    count_FX = reaper.TrackFX_GetCount(track)    

local nnner2 =  reaper.NamedCommandLookup("_SWS_SELMASTER")
stats = reaper.Main_OnCommand(nnner2,0)


local nnner2 =  reaper.NamedCommandLookup("_SWS_SAVESEL")
reaper.Main_OnCommand(nnner2,0)
 reaper.Main_OnCommand(40297, 0)
local nnner2 =  reaper.NamedCommandLookup("_SWS_SELMASTER")
reaper.Main_OnCommand(nnner2,0)
local nnner2 =  reaper.NamedCommandLookup("_S&M_CLRFXCHAIN3")
reaper.Main_OnCommand(nnner2,0)
local nnner2 =  reaper.NamedCommandLookup("_SWS_RESTORESEL")
reaper.Main_OnCommand(nnner2,0)
