function SplitFilename(strFilename)
  return string.match(strFilename, "(.-)([^.]+)$")
end


function nothing()
end

sel_t_cnt = reaper.CountSelectedTracks(0)

if sel_t_cnt >= 0 then
  t = reaper.GetSelectedTrack(0, 0)
  t_send_cnt = reaper.GetTrackNumSends(t, -1)
N =     t_send_cnt
  if t_send_cnt >= 0 then

    script_title = "show selected track receives fx window"
    reaper.Undo_BeginBlock()
Z = ""    
    for x = 0, t_send_cnt-1 do
      t_send = reaper.BR_GetMediaTrackSendInfo_Track(t, -1, x, 0) -- get x recieve of sel track
local Omena = ""
local Numberer = reaper.GetMediaTrackInfo_Value(t_send,"IP_TRACKNUMBER")
 Numberer1,  Numberer2=  SplitFilename(Numberer)
pp = 1
                local  Numberer1 = string.match(string.reverse( Numberer1),".+",pp+1)
                local  Numberer1 = string.reverse( Numberer1)

Z = Z .. Numberer1 .. " "

    end



if N == 1 then
NN = " Recieve "
else
NN = " Recieves "
end

if Z == "" then
YY = " No Receive "
else
YY = " has " ..N .. NN .. " from " ..Z
end


--     reaper.osara_outputMessage(Y)
    reaper.Undo_EndBlock(script_title, -1)
    
  else
    reaper.defer(nothing)
  end
else
  reaper.defer(nothing)
end
function SplitFilename(strFilename)
  return string.match(strFilename, "(.-)([^.]+)$")
end



    
    
    local function RetNumbTable(T);local x=0;for key,val in pairs(T)do;x=x+1;end;return x;end;
    
    
    
    --========================================================================
    local CountSelTrack = reaper.CountSelectedTracks(0);

    
    
    local T         = {};
    local selTrackT = {};
    local totalT    = {};
    local nameSetT  = {};
    local Undo;
    local NAME_Coincides;
    
    
    for i = 1, CountSelTrack do;
        local SendTrack = reaper.GetSelectedTrack(0,i-1);
        local GUID = reaper.GetTrackGUID(SendTrack);
        local _,stringNeedBig = reaper.GetSetMediaTrackInfo_String(SendTrack,"P_NAME",0,0);
        selTrackT[GUID]=SendTrack
        nameSetT[stringNeedBig]=stringNeedBig;  
    end;
    
    
    
    for i = 1, CountSelTrack do;
    
        local TrackSel = reaper.GetSelectedTrack(0,i-1);
        ----
        local NumSends = reaper.GetTrackNumSends(TrackSel,0);
if  NumSends  == nil then
XX = ""
else
XX = NumSends 
end
        for i = 1, NumSends do;
            local SendTrack = reaper.BR_GetMediaTrackSendInfo_Track(TrackSel,0,i-1,1);
            local GUID = reaper.GetTrackGUID(SendTrack);
            T[GUID] = SendTrack;
        end;

        
        ----------------------------
        ::ToLookFurther::;
        local x = RetNumbTable(T);

        for key, val in pairs(T) do;
            local NumSends = reaper.GetTrackNumSends(val,0);
            for i = 1, NumSends do;
                local SendTrack = reaper.BR_GetMediaTrackSendInfo_Track(val,0,i-1,1);
                local GUID = reaper.GetTrackGUID(SendTrack);
                T[GUID] = SendTrack;
            end;
        end
        
        if x ~= RetNumbTable(T) then goto ToLookFurther end;
        ----------------------------
        
        
        for key, val in pairs(T) do;
            totalT[key] = val;
        end;
        
        T = {};
    end;
    --========================================================================
    
    
    

 if RetNumbTable(totalT) > 0 then;
        local CountTracks = reaper.CountTracks(0);
local Omena =""

        for i = 1, CountTracks do;
            local Track = reaper.GetTrack(0,i-1);
            local GUID = reaper.GetTrackGUID(Track);
local Numberer = reaper.GetMediaTrackInfo_Value(Track, "IP_TRACKNUMBER")

            if  totalT[GUID] and not selTrackT[GUID] then;
--                local show = reaper.GetMediaTrackInfo_Value(Track,"B_SHOWINTCP");
 Numberer1,  Numberer2=  SplitFilename(Numberer)
pp = 1
                local  Numberer1 = string.match(string.reverse( Numberer1),".+",pp+1)
                local  Numberer1 = string.reverse( Numberer1)

Omena = Omena .. Numberer1 .. " "








            end;
        end;

if XX == 1 then
 sender = " Send "
else
 sender = " Sends "
end

if XX == "" then
ZZ = "No Send "
else


ZZ =" has " ..  XX.. sender  .." to track " .. Omena
end

end
if ZZ == nil then
ZZ = " No send "
end
 reaper.osara_outputMessage(ZZ.. YY)