Welcome Guest

Pages: 1
Run action on each track individually
Gary-SwiftPostApril 6, 2025, 08:00
Beginner
Posts: 43
Registered:
April 29, 2014, 06:12
Normal topicRun action on each track individually

I have the following action that compares a UDTI field to the Title field and removes it if it is the same. (I'm copying the value to a variable to achieve this.)

It works fine on a single file. It does not work when I run the action on multiple files.

How do I run this for all selected files?

I'm guessing there is some sort of batch process but I can't see it.

Save value of User Defined Text Item with name 'WORK' to Variable 0
Test if the Title field is equal to Variable 0 (Set test state)
if true
    Remove User Defined Text Item with name 'WORK' (set state all)
endif
Gary-SwiftPostApril 6, 2025, 08:12
Beginner
Posts: 43
Registered:
April 29, 2014, 06:12
Normal topicRun action on each track individually

I think I figured it out. This seems to work for me, at least.

I went through the functions and found "Force Grouped Execution". I added that to the start of the action it seems to work as expected now.

Image

2MR2PostApril 6, 2025, 08:59
Avatar photo
Administrator
Posts: 2227
Registered:
August 23, 2012, 19:27
Normal topicRun action on each track individually

In your first screenshot you're not accounting for the parallelism of action statements. The Compare statement in the first action (Test if the Title field is equal to Variable 0...) sets the action test state to true if all files pass the test. This will cause the subsequent if true to fail if at least one active file does not have the UDTI you're looking for.

Your second action forces each file to be processed individually which works. However this is at a cost. If you have 500 files selected, the action is essentially being run 500 times. The Set state all on the remove in both actions is not doing anything in either case as you're not testing the state.

A better solution would be to handle the parallelism as follows:

1: Save value of User Defined Text Item with name 'WORK' to Variable 0
2: Test if the Title field is equal to "WORK" (Set test state and Variable 15)
3: if Variable 15 is true
4: Remove User Defined Text Item with name 'WORK'
5: endif

Statement 2 performs the same test and returns the same action test state result based on all files. However, it saves the per file result to Variable 15. The if statement on line 3 does not test the action test state but rather it tests if Variable 15 is true in all active files. It guarantees that only those files which have Variable 15 as true will be active until [b]the if-else-endif sequence is exited, Any Variable can be used ... it does not have to be 15. This solution executes once, regardless of the number of selected files.

Gary-SwiftPostApril 7, 2025, 14:50
Beginner
Posts: 43
Registered:
April 29, 2014, 06:12
Normal topicRun action on each track individually

Ok, got it. Although in step 2, I compared Title field to Variable 0 (and set state to Variable 15).

That's great, thank you. It's working as expected now.

Save value of User Defined Text Item with name 'WORK' to Variable 0
Test if the Title field is equal to Variable 0 (Set test state and Variable 15)
if Variable 15 is true
    Remove User Defined Text Item with name 'WORK' (set state all)
endif
2MR2PostApril 7, 2025, 14:55
Avatar photo
Administrator
Posts: 2227
Registered:
August 23, 2012, 19:27
Normal topicRun action on each track individually

My bad, too rushed. I'm glad you caught the error 🙂

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.027 seconds.