# Check if field value is identical for all selected tracks

**URL:** https://community.mp3tag.de/t/check-if-field-value-is-identical-for-all-selected-tracks/13244
**Category:** Export
**Created:** [March 20, 2012, 11:28pm UTC](https://community.mp3tag.de/t/check-if-field-value-is-identical-for-all-selected-tracks/13244 "2012-03-20T23:28:28Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [March 21, 2012, 4:29am UTC](https://community.mp3tag.de/t/check-if-field-value-is-identical-for-all-selected-tracks/13244/3 "2012-03-21T04:29:37Z")

</div>

> [@Kevin04](#):
>
> ... I want it to write the value if it's the same for all selected files, but write some fixed value like "Various" if it differs.  
> I tried it with a user-defined variable and a seperate loop like this: ...  
> Setting the variable first (so it can be checked against), then check if it matches for each track. ...  
> I hope I'm just missing something obvious or doing something wrong. Thanks in advance.

I think, in a Mp3tag export script the visibility of a user defined variable is limited to the current loop block.  
And yes, there might be a trick to use a user-defined variable, which has been defined outside of the current loop block.  
I remember I have discovered something like this ... once the user-defined variable has been 'elevated' into the 'global loop stage memory' it can be used within other loop blocks.  
Sadly I do not know it from my memory yet, how I have done it.  
( ... try to find some of my recent export scripts here in the forum. ... ;-))

Hmm, study the attached test export script, maybe you can see how it could work.  
[20110601.Test.Visibility.\_puts.mte](https://community.mp3tag.de/uploads/default/original/2X/d/d152fb55f34549ed3e0e9b375c03547a0553a09f.mte) (2 KB)

DD.20120321.0630.CET

[20110601.Test.Visibility.\_puts.mte](https://community.mp3tag.de/uploads/default/original/2X/d/d152fb55f34549ed3e0e9b375c03547a0553a09f.mte) (2 KB)

---

_[View the full topic](https://community.mp3tag.de/t/check-if-field-value-is-identical-for-all-selected-tracks/13244)._
