Sequential numbering action

Is there an action that will set a field to an autoincrementing number start at the value of the first track?

E.g. I select four tracks, the first of which has track number = 42 . I reun the action. This leaves the tracks numbered 42, 43, 44, 45.

Thanks.

You can do that with the Autonumbering wizard.

Just change the value for "Begin at tracknumber".

Thanks, but Autonumbering wizard is inaccessible from an action. I do need this in an action.

Begin Action Group Format TRACK#Set TRACK count from 42

Action #1
Actiontype 5: Format value
Field ______: TRACK
Formatstring: 42

Action #2
Actiontype 5: Format value
Field ______: TRACK
Formatstring: $add(%TRACK%,$sub(%_counter%,1))

End Action Group Format TRACK#Set TRACK count from 42 (2 Actions)

... or ...

The following proposal is nothing for production use.
It is just a hack around the limitations of mp3tag, ...
... because currently there is no shared memory between two tracks.
Unfortunately there is no action to remove a (temporary) file from the filesystem.

Begin Action Group Format TRACK#Set TRACK count from given number

Action #1
Actiontype 15: Export
Select script filename: Test.20140914.chrisjj.CountTrackStart
Export filename ______: $getEnv('USERPROFILE')'\Desktop\Export.Whatever.txt'

[_] Append data [_] One file per folder

Action #2
Actiontype 14: Import text file
Field __: TRACK
Filename: $getEnv('USERPROFILE')'\Desktop\Export.Whatever.txt'

Action #3
Actiontype 5: Format value
Field ______: TRACK
Formatstring: $add(%TRACK%,$sub(%_counter%,1))

End Action Group Format TRACK#Set TRACK count from given number (3 Actions)

Test.20140914.chrisjj.CountTrackStart.mte

$filename($getEnv('USERPROFILE')'\Desktop\Export.Whatever.txt',UTF-8)%TRACK%

Note:
For some reason Mp3tag executes the export as recently as at the end of action group, so the action group has to be performed twice.
The export output file must not exist when starting the procedure.

You may split this process into two independent action groups

DD.20140914.1321.CEST

Thanks D.

The first is unsuitable because the start value is not the existing value of the first track.

The second looks promising. Is there some tool to import your listing into the .mte?

Florian explains here: /t/6286/1

Why is that?

Perhaps that avoids "so the action group has to be performed twice."

I could have offered the mte file, but you would like to rename it anyway ... :wink:

If the export output file from the last run does exist, then the stored value from this file will be read, on the first run of the three-steps action, and this will cause erroneous behaviour.

I would say yes.

There will stay the unsolved problem to automatically remove the temporary export text file.
Maybe it could be done by an additionally exported cmd file, which deletes the data file and itself.

DD.20140914.1501.CEST

Ah, I see. Indeed unacceptable for production.

Perhaps this could be solved by an initial group that empties the file, using an export action.

I can make the remaining temporary desktop file acceptable to me by placing it instead in %TEMP% .

I was unaware that an action could execute a cmd file.

You can use the export feature of Mp3tag to create textual output, and name the filetype of the output file as you wish, you know that already, I am sure, there are many examples in the forum.
Yes, the problem is, that Mp3tag does not 'invoke' or 'execute' or 'launch' an export script from within a running action.
When using [Strg+E] Export, the just created export script will be 'launched' and so it can be 'executed'.

DD.20140914.1841.CEST

Indeed. But as you say, that is not 'execute'.

If the Mp3tag export feature creates a text file named like "however export script.cmd", then it will be automatically launched to the system, perhaps a Mp3tag warning will come up (maybe adjustable in Tools/Options), then the cmd script will be executed.

DD.20140914.1927.CEST

Not in an action, I find.

[garbage removed]

Here is another proposal, coded as a 2-step process, last trial ...

Begin Action Group Format TRACK#Set TRACK count from given number.step1

Action #1
Actiontype 9: Remove fields
Fields to remove (semicolon separated): TRACK_TMP

Action #2
Actiontype 15: Export
Select script filename: Test.20140914.Track.tmp.step1
Export filename ______: $getEnv('TEMP')'\Track.tmp.txt'

[_] Append data [_] One file per folder

End Action Group Format TRACK#Set TRACK count from given number.step1 (2 Actions)

Begin Action Group Format TRACK#Set TRACK count from given number.step2

Action #1
Actiontype 14: Import text file
Field __: TRACK_TMP
Filename: $getEnv('TEMP')'\Track.tmp.txt'

Action #2
Actiontype 5: Format value
Field ______: TRACK_TMP
Formatstring: $regexp(%TRACK_TMP%,'(\D.)$',)

Action #3
Actiontype 5: Format value
Field ______: TRACK
Formatstring: $if(%TRACK_TMP%,$add($num(%TRACK_TMP%,1),$sub(%_counter%,1)),%TRACK%)

Action #4
Actiontype 9: Remove fields
Fields to remove (semicolon separated): TRACK_TMP

End Action Group Format TRACK#Set TRACK count from given number.step2 (4 Actions)

Export script ...
Test.20140914.Track.tmp.step1

$filename($getEnv('TEMP')'\Track.tmp.txt',ANSI)%TRACK%

How to use ...

  1. Select the tracks to renumber.
  2. Execute action "Format TRACK#Set TRACK count from given number.step1"
  3. Execute action "Format TRACK#Set TRACK count from given number.step2"

You may create menu entries for both action groups in the Actions dialog "Utils".

Open questions:

  • How to open "Utils" directly with only one hotkey?
  • How to execute one specific meta group directly with only one hotkey?

DD.20140915.1332.CEST, DD.20140915.1714.CEST, DD.20140915.1959.CEST, DD.20140916.0936.CEST

They appear in one menu group http://i.imgur.com/zTAWOVu.png but here cannot be started by that single menu command.

So I shall use the "Action groups" dialog http://i.imgur.com/nLVYbf3.png

First run gives this error: http://i.imgur.com/WaPoYEQ.png . I have no idea why.

Second run fails silently. Perhaps CountTrackStop is misplaced?

For several hours each day I sit behind a firewall that does allow access to that picture server you prefer to use.
So could you either please upload the pictures to the mp3tag server or describe what they show?

Make sure, within the Export dialog, which is called from within an action, that the filename edit field knows the correct output filename (we know this problem already).

DD.20140915.1710.CEST

See changes in post #12.

DD.20140915.2004.CEST, DD.20140916.0943.CEST

I did. It looks fine:

http://i.imgur.com/QeZAUYo.png
http://i.imgur.com/pDTp7CH.png