# Feature Request - Export $loop() default sorting

**URL:** https://community.mp3tag.de/t/feature-request-export-loop-default-sorting/70118
**Category:** Support
**Created:** [November 11, 2025, 7:02am UTC](https://community.mp3tag.de/t/feature-request-export-loop-default-sorting/70118 "2025-11-11T07:02:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Oblio](https://community.mp3tag.de/user_avatar/community.mp3tag.de/oblio/32/4828_2.png) [@Oblio](https://community.mp3tag.de/u/Oblio)
#### Post date: [November 11, 2025, 7:02am UTC](https://community.mp3tag.de/t/feature-request-export-loop-default-sorting/70118/1 "2025-11-11T07:02:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 11, 2025, 7:04am UTC](https://community.mp3tag.de/t/feature-request-export-loop-default-sorting/70118/2 "2025-11-11T07:04:21Z")

</div>

> [@Oblio](#):
>
> $loop() function default to sorting by track list order

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

---

<div class="post-metadata">

### Author: ![Oblio](https://community.mp3tag.de/user_avatar/community.mp3tag.de/oblio/32/4828_2.png) [@Oblio](https://community.mp3tag.de/u/Oblio)
#### Post date: [November 11, 2025, 7:07am UTC](https://community.mp3tag.de/t/feature-request-export-loop-default-sorting/70118/3 "2025-11-11T07:07:09Z")

</div>

Works! Thank you! 🙂

Undocumented feature?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [November 11, 2025, 7:19am UTC](https://community.mp3tag.de/t/feature-request-export-loop-default-sorting/70118/4 "2025-11-11T07:19:34Z")

</div>

> [@Oblio](#):
>
> Undocumented feature?

The [documentation](https://docs.mp3tag.de/export/#export-scripting-functions) 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.

---

<div class="post-metadata">

### Author: ![Oblio](https://community.mp3tag.de/user_avatar/community.mp3tag.de/oblio/32/4828_2.png) [@Oblio](https://community.mp3tag.de/u/Oblio)
#### Post date: [November 11, 2025, 7:30am UTC](https://community.mp3tag.de/t/feature-request-export-loop-default-sorting/70118/5 "2025-11-11T07:30:01Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:30pm UTC](https://community.mp3tag.de/t/feature-request-export-loop-default-sorting/70118/6 "2026-02-09T12:30:23Z")

</div>


