<?xml version="1.0" encoding="utf-8"?>
<HmsProcessMediaConfig version="2.14">
  <ProcessMediaItemList>
    <ProcessMediaItem>
      <HotKey>0</HotKey>
      <Description></Description>
      <Name>Очистка недавно добавленных</Name>
      <ButtonName></ButtonName>
      <Button>0</Button>
      <Script>Const
  //------------------------------------------------
  iDaysToSave = 20; // Количество дней для сохранения истории, 0 - для полной очистки папки
  //------------------------------------------------
  iDaysInSec = 60*60*24*iDaysToSave;
Var
  FolderItem, Item: THmsScriptMediaItem;
  i, iCount: Integer;
  d1, d2, d3: String;
  dd: TDateTime;
  vCreateDate,vCurrDate,dYears: Variant;
Begin
  vCurrDate := DateTimeToTimeStamp1970(Date, False);
  FolderItem := HmsFindMediaFolder(mfVideoCollectionsItemID).FindItemByProperty(mpiTitle,&apos;Недавно добавленные&apos;);
  For i := FolderItem.ChildCount-1 DownTo 0 Do Begin
    Item := FolderItem.ChildItems[i];
    dd := StrToDate(ExtractWord(3,Item.Properties[mpiTitle],&apos;-&apos;)+&apos;.&apos;+ExtractWord(2,Item.Properties[mpiTitle],&apos;-&apos;)+&apos;.&apos;+ExtractWord(1,Item.Properties[mpiTitle],&apos;-&apos;));
    vCreateDate := DateTimeToTimeStamp1970(dd, False);
    If (vCurrDate - vCreateDate) &gt; (iDaysInSec) Then
     Begin
       Item.Delete;
       iCount := iCount + 1;
     End;
  End;
  HmsLogMessage(1, &apos;Очищено &apos;+ IntToStr(iCount) + &apos; ссылок&apos;);
End.</Script>
      <ScriptSyntaxType>PascalScript</ScriptSyntaxType>
      <ScheduleActive>0</ScheduleActive>
      <Schedule>
        <TaskName></TaskName>
        <TaskParams></TaskParams>
        <Occurs>0</Occurs>
        <DailyMode>0</DailyMode>
        <DailyDaysInterval>1</DailyDaysInterval>
        <WeeklyDaysOfWeek>127</WeeklyDaysOfWeek>
        <WeeklyWeekInterval>1</WeeklyWeekInterval>
        <MonthlyMode>0</MonthlyMode>
        <MonthlyDayOfMonth>1</MonthlyDayOfMonth>
        <MonthlyWeekOfMonth>0</MonthlyWeekOfMonth>
        <MonthlyDayOfWeek>0</MonthlyDayOfWeek>
        <MonthlyMonths>4095</MonthlyMonths>
        <DailyFrequency>0</DailyFrequency>
        <OnceAtTime>0</OnceAtTime>
        <ExecuteTimeList></ExecuteTimeList>
        <TimeUnit>0</TimeUnit>
        <TimeInterval>3600</TimeInterval>
        <TimeStart>0</TimeStart>
        <TimeEnd>86399</TimeEnd>
        <DateStart>42485</DateStart>
        <NoEndDate>-1</NoEndDate>
      </Schedule>
    </ProcessMediaItem>
  </ProcessMediaItemList>
</HmsProcessMediaConfig>
