Feature Request - Export $loop() default sorting

I am writing an Autohotkey script to create an export mte file from columns.ini for a quick way of exporting the currently enabled columns to Excel.

The only thing I can’t get working is to keep the current track list order.

Could you make the $loop() function default to sorting by track list order when no field is specified?

Thanks.

Try $loop(1) to get the order as sorted in the selected files

Works! Thank you! :slightly_smiling_face:

Undocumented feature?

The documentation says:
$loop(%fieldname%,num) Starts a new loop. The loop data is sorted by the given field name. The optional second parameter limits the loop output to a certain number of entries. This is useful to eliminate duplicate records (num=1)

Admittedly, it is not very obvious but if you do not set a fieldname, then there is nothing to sort by and the order is taken as it is.

It looks like you can put anything in there as long as it’s not a valid field name or blank. e.g. $loop(%%) works and $loop(dfkhgkjhgkjhg) works.

I still think it’s a good idea to make $loop() work the same way.