  reaper.Undo_BeginBlock()
  for key in pairs(reaper) do _G[key]=reaper[key]  end 


  
  item = reaper.GetSelectedMediaItem(0,0)
  if item == nil then return end
    take = reaper.GetActiveTake(item)
    if take == nil then return end 
    local tkpan = GetMediaItemTakeInfo_Value( take, 'D_PAN' )
volp = tkpan * 100
retval, mena  = reaper.GetUserInputs("ChangeTakePan", 1, "", volp)
 tkpan_out = mena/100  
if  tkpan_out >= -1.0 then
if  tkpan_out <= 1.0 then
    SetMediaItemTakeInfo_Value( take, 'D_PAN', tkpan_out)
    UpdateItemInProject( item )
end
end
  reaper.Undo_EndBlock("change take pan take ", -1)