Select files newer than current one

Far Manager Macro System

Select files newer than current one


-- Select all files newer than the current one in the active panel,
-- using plugin API (LuaFAR).
Macro {
  description="Select all files/folders newer than the current one in the active panel";
  area="Shell"; key="CtrlM";
  action=function()
    local info = panel.GetPanelInfo(nil,1)
    local curItem = panel.GetCurrentPanelItem(nil,1)
    for i=1,info.ItemsNumber do
      local item = panel.GetPanelItem(nil,1,i)
      if item.LastWriteTime > curItem.LastWriteTime then
        panel.SetSelection(nil,1,i,true)
      end
    end
    panel.RedrawPanel(nil,1)
  end;
}
-- Select all files newer than the current one in the active panel,
-- using macro API (LuaFAR + LuaMacro).
Macro {
  description="Select all files/folders newer than the current one in the active panel";
  area="Shell"; key="CtrlM";
  action=function()
    d = Panel.Item(0,0,17)
    for i=1,APanel.ItemCount do
      if Panel.Item(0,i,17) > d then
        Panel.Select(0,1,1,i)
      end
    end
  end;
}