Sorry for the long delay. Somehow I did not receive a notification.
Here's a snippet to test if PMEDIA contains 5 and to remove it if it does:
1: Test if text "\^PMEDIA^" is equal to "5" (Set test state)
2: if true
3: Remove User Defined Text Item 'PMEDIA'
4: endif
Statement 1 is a Compare Text statement with the source set as Text. An escape sequence is used to load the value of UDTI PMEDIA. See the attached screenshot.
Statement 3 is a Set User Defined Item statement. When setting a UDTI to empty it is removed.
Note that this snippet and the one you used for COmmenst is only valid one a single file at a time due to the test logic. The following snippet would work on all selected files at once:
1: Test if text "\^PMEDIA^" is equal to "5" (Set test state and Variable 0)
2: Ignore files where Variable 0 is false
3: if true
4: Remove User Defined Text Item 'PMEDIA'
5: Restore Initial Set of Files
6: endif
Statement saves the result of the test on each file to track variable 0.
Statement 2 ignores files where variable 0 is false. ie. PMEDIA is not 5.
The contents of the If on statement 3 is only executed if statement 2 resulted in at least one file still being active. Statement 5 restores the initial set of files.
Hopefully this helps. Again, sorry for the delay.

|