Script Export Plaintext indicating the time elapsed in each track

Hello Mp3Tag Team!

Is it possible to create a script in Mp3tag in "Export Configuration" (mte file) that exports the tracklist in txt.* and shows the time elapsed in each track, like the example below? The values in the "INDEX CUE" column will be obtained from the CUE file loaded into Mp3tag, from the "INDEX 01 XX:XX:XX" lines.

CUE example loaded into Mp3tag:

"...TRACK 01 AUDIO
TITLE "Pure Shores"
PERFORMER "All Saints"
INDEX 01 00:00:00
TRACK 02 AUDIO
TITLE "Never Ever"
PERFORMER "All Saints"
INDEX 01 04:28:45
TRACK 03 AUDIO
TITLE "Under The Bridge"
PERFORMER "All Saints"
INDEX 01 10:55:52
TRACK 04 AUDIO
TITLE "Lady Marmalade"
PERFORMER "All Saints"
INDEX 01 15:58:20
..."

Exported TXT example:

Track Name Time INDEX CUE


  1. Pure Shores 04:28 | 00:00
  2. Never Ever 06:27 | 04:28
  3. Under The Bridge 05:02 | 10:55
  4. Lady Marmalade 04:03 | 15:58
    ..."
    Thank you in advance for your help.

Here is a basic approach:

$filename(txt,utf-16)Title;Length
$loop(%title%)%title%;%_length%$puts(%elapsedtime%,$add($get(%elapsedtime%),%_length_seconds%))--$div($get(%elapsedtime%),60):$mod($get(%elapsedtime%),60)
$loopend()

Probably it needs a little refinement in respect to formatting. And the output does not deal with an elapsed time over 60 minutes ...

Thank you very much for the help, Ohrenkino.

The script needs some adjustments because the timings of the tracks in the text are not the same as those in the CUE file. Example:

5;I Know Where It's At (Original Mix);04:54--24:54

TITLE "I Know Where It's At (Original Mix)"
INDEX 01 20:02:05

Below are the cue file and the exported filetext:

CUE FILE :

TRACK 01 AUDIO
TITLE "Pure Shores"
PERFORMER "All Saints"
INDEX 01 00:00:00
TRACK 02 AUDIO
TITLE "Never Ever"
PERFORMER "All Saints"
INDEX 01 04:28:45
TRACK 03 AUDIO
TITLE "Under The Bridge"
PERFORMER "All Saints"
INDEX 01 10:55:52
TRACK 04 AUDIO
TITLE "Lady Marmalade (98 Remix)"
PERFORMER "All Saints"
INDEX 01 15:58:20
TRACK 05 AUDIO
TITLE "I Know Where It's At (Original Mix)"
PERFORMER "All Saints"
INDEX 01 20:02:05
TRACK 06 AUDIO
TITLE "Twentyfourseven (Radio Version) - Artful Dodger feat. Melanie Blatt"
PERFORMER "All Saints"
INDEX 01 24:56:60
TRACK 07 AUDIO
TITLE "Black Coffee"
PERFORMER "All Saints"
INDEX 01 28:45:47
TRACK 08 AUDIO
TITLE "Bootie Call (Single Version)"
PERFORMER "All Saints"
INDEX 01 33:35:05
TRACK 09 AUDIO
TITLE "All Hooked Up (Single Version)"
PERFORMER "All Saints"
INDEX 01 37:10:52
TRACK 10 AUDIO
TITLE "War Of Nerves (98 Remix)"
PERFORMER "All Saints"
INDEX 01 41:00:50
TRACK 11 AUDIO
TITLE "Pure Shores (2 Da Beach U Don't Stop Remix)"
PERFORMER "All Saints"
INDEX 01 45:50:00
TRACK 12 AUDIO
TITLE "I Feel You"
PERFORMER "All Saints"
INDEX 01 50:52:35
TRACK 13 AUDIO
TITLE "Dreams"
PERFORMER "All Saints"
INDEX 01 56:30:45

TEXT FILE:

Title;Length

1;Pure Shores;04:28--4:28
2;Never Ever;06:27--10:55
3;Under The Bridge;05:02--15:57
4;Lady Marmalade (98 Remix);04:03--20:0
5;I Know Where It's At (Original Mix);04:54--24:54
6;Twentyfourseven (Radio Version) - Artful Dodger feat. Melanie Blatt;03:48--28:42
7;Black Coffee;04:49--33:31
8;Bootie Call (Single Version);03:35--37:6
9;All Hooked Up (Single Version);03:49--40:55
10;War Of Nerves (98 Remix);04:49--45:44
11;Pure Shores (2 Da Beach U Don't Stop Remix);05:02--50:46
12;I Feel You;05:38--56:24
13;Dreams;04:27--60:51

The correct option would be for the script to read the lines "INDEX 01 XX:XX:XX" and return the value directly in the textfile in HH:MM:SS. I just don't know if it's possible to do that.

Sorry my english.

Paulo Almeida

So you want to convert the (plain text) cue file into a text file that is formatted in a different way?
This would be a task that can be done better with a text editor.

In addition: MP3tag does not return the milliseconds of a file, just the full seconds.

looks to me like minutes:seconds:milliseconds. and not

... the minutes:seconds was in your original output example, BTW.

AFAIK MP3tag takes the data from the selected files for a export. You could also import tag data from a cue file. But you cannot change properties like _LENGTH with an import.