Searching for script 'Mark selected mixdown items as played with date in mairlist database

Hi all,
I use Mairlist for voicetrack recording my weekley show. After an hour I select alle items and putnthem tot a mixdown location. Works superbe and was the main reason I bought a Mairlist license.

But… mixdowned songs don’t register ‘played with playdate’ in the database. So, they could easily appear again the next time I record my show. It would be a great addition to the standard options in Mairlist…

To create a workaround I asked chatGPT to write me a script ( I have no idea hor to compose something myself :wink: but, as you can guess: it doesn’t work.

This is what chatGPT came up with:

==============

program mAirListPlaylistScript;

uses
SysUtils;

const
PlaylistDatabasePath = ‘C:\Path\To\Playlist\Database.mldb’;

type
TPlaylistItem = record
Title: string;
Artist: string;
DatePlayed: TDateTime;
// Add any other necessary fields here
end;

var
Playlist: array of TPlaylistItem;
SelectedItems: array of Boolean;

procedure LoadPlaylist;
var
DatabaseFile: TextFile;
Line: string;
ItemIndex: Integer;
begin
AssignFile(DatabaseFile, PlaylistDatabasePath);
Reset(DatabaseFile);

ItemIndex := 0;
while not EOF(DatabaseFile) do
begin
ReadLn(DatabaseFile, Line);
// Parse the line and extract necessary fields
// You may need to adjust the parsing logic based on your database structure
// For example, if the fields are separated by a specific delimiter, you can use the SplitString function
// to split the line into an array of fields.
// Example: SplitString(Line, ‘;’, Fields);
// The first field is the title, the second is the artist, etc.

Playlist[ItemIndex].Title := Title; // Assign the parsed title to the playlist item
Playlist[ItemIndex].Artist := Artist; // Assign the parsed artist to the playlist item
Playlist[ItemIndex].DatePlayed := DatePlayed; // Assign the parsed date played to the playlist item

Inc(ItemIndex);

end;

CloseFile(DatabaseFile);
end;

procedure MarkItemsAsPlayed;
var
DatabaseFile: TextFile;
Line: string;
ItemIndex: Integer;
begin
AssignFile(DatabaseFile, PlaylistDatabasePath);
Reset(DatabaseFile);

ItemIndex := 0;
while not EOF(DatabaseFile) do
begin
ReadLn(DatabaseFile, Line);
// Parse the line and extract necessary fields
// Similar to the LoadPlaylist procedure, parse the line and assign values to variables

// Check if the item is selected
if SelectedItems[ItemIndex] then
begin
  // Update the date played field
  Playlist[ItemIndex].DatePlayed := Now;

  // Reconstruct the line with the updated date played field
  // and write it back to the database file
  // You may need to adjust the formatting based on your database structure
  // For example, if the fields are separated by a specific delimiter, you can use the JoinString function
  // to concatenate the fields into a single string with the delimiter.
  // Example: Line := JoinString(Fields, ';');
  // WriteLn(DatabaseFile, Line);
end;

Inc(ItemIndex);

end;

CloseFile(DatabaseFile);
end;

begin
SetLength(Playlist, 100); // Adjust the length based on the number of playlist items
SetLength(SelectedItems, 100); // Adjust the length based on the number of playlist items

LoadPlaylist;

// Perform any necessary operations to determine which items are selected
// and populate the SelectedItems array accordingly

MarkItemsAsPlayed;

// Perform any other necessary operations

WriteLn(‘Playlist items marked as played.’);

// Wait for user input to exit the script
WriteLn(‘Press Enter to exit.’);
ReadLn;
end.

============

Anyone?