Export to text: Conditional output based on loopend

I did not check the JSON code.

It seems that you describe a problem with a comma separated list, and with a trailing comma at end of the list.
There might be more than one possible solutions.
One is, do not write a trailing comma after each array object, but write a leading comma before each following array object, starting from object #2.
For the very first array object, suppress the leading comma.

(... this seems to be semantically correct, because the separator comma is indeed the connector between the previous and the following item, and the separator comma is indeed a property of the following item, and a leading separator comma is not defined for the first item in the list).

Example:

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

02: $loop(%_filename_ext%)$ifgreater(%_counter%,1,',',)'{'
03: '"trackNumber":"'$num(%TRACK%,2)'",'
04: '"title":"'%TITLE%'",'
05: '"artists":"'%ARTIST%'",'
06: '"composers":"'%COMPOSER%'",'
07: '"length":"'%_length%'",'
08: '"bitRate":"'[%_bitrate%'kbps'[' '%_vbr%]]'",'
09: '"fileName":"'%_filename_ext%'",'
10: '"fileSize":"'%_file_size%'"'
11: '}'$loopend()

DD.20150202.0928.CET, DD.20150202.1211.CET

See also ... the other way round ... a slightly other problem ...
"Determine the last loop"
... which needs a little bit more coding ... my proposal from there ...

Determine the last loop inside loop?

DD.20150203.0913.CET