Xitem = reaper.CountMediaItems(0)
		reaper.Main_OnCommand(41168, 0)
    local CursorPosition3 = reaper.GetCursorPosition();
	reaper.Main_OnCommand(40289, 0) -- Unselect all items
		reaper.Main_OnCommand(40297, 0) -- Unselect all tracks (so that it can copy items)
	for i = 0,Xitem-1  do
		item = reaper.GetMediaItem(0, i)
			item_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION")
		track = reaper.GetMediaItem_Track(item)
		if item_pos == CursorPosition3  then
--		reaper.SetTrackSelected(track, true)
   reaper.SetMediaItemSelected(item, true)
    reaper.SetOnlyTrackSelected(track)
end
end
local timer2 =  reaper.NamedCommandLookup("_OSARA_REPORTSEL")
		reaper.Main_OnCommand(timer2, 0)

