You're running up against the parallelism of Yate actions. When an action starts executing, the action is run stepwise ... every step (or statement) is run against all files before proceeding to the next statement. This was designed this way about 12 years ago so that different things could be done to multiple files with a single statement.
For example when you append Remixed by remixer to Title in a single statement, every Title field will potentially end up with different content.
It was also designed that way to minimize statement execution through the interpreter. If you have a test sequence containing 5 statements and you're running against 100 files, it requires 500 statement executions to perform the operation when grouped. If the entire operation is the same for all files, only 5 statements will be executed.
However, there are times when you want to run grouped (one statement against one file). Typically this is due to a comparison.
The internal How Actions Execute help topic covers this. There is also a more extensive document available in the Documentation section of the resources page called Yate and the P Word which goes into more depth.
Note regarding the following examples: the mailer tends to strip out backslash characters. View the examples in the forum.
Example 1: At any given time you can make an entire action run grouped by placing a Force Grouped Execution statement as the first statement in the action. This variant is the worst if you have a lot of files loaded.
Force Grouped Execution
' Example 1: Fully grouped
Test if the Title field is equal to "Untitled" case insensitive (Set result)
if true
Test if the Remixer field is empty (Set result)
if true
Copy the Track field to Variable 0
Make Variable 0 numeric padding to 2 digits
Set the Title field to "Untitled \v0"
else
Set the Title field to "Untitled (Remixed by \[Remixer])"
endif
endif
Example 2: This variant runs completely stepwise.
' Example 2: Fully stepwise
Test if the Title field is equal to "Untitled" case insensitive (Set result and Variable 0)
Test if the Remixer field is empty (And result and Variable 0)
Ignore files where Variable 0 is false
if true
Copy the Track field to Variable 0
Make Variable 0 numeric padding to 2 digits
Set the Title field to "Untitled \v0"
Restore Initial Set of Files
endif
Test if the Title field is equal to "Untitled" case insensitive (Set result and Variable 0)
Test if the Remixer field is not empty (And result and Variable 0)
Ignore files where Variable 0 is false
if true
Set the Title field to "Untitled (Remixed by \[Remixer])"
endif
Example 3: This variant is a hybrid and only runs grouped for those files which initially have a Title field with Untitled as its value.
' Example 3: Hybrid
Test if the Title field is equal to "Untitled" case insensitive (Set result and Variable 0)
Run inline action 'Modify One File' grouped if Variable 0 is true
Start Modify One File
Test if the Remixer field is empty (Set result)
if true
Copy the Track field to Variable 0
Make Variable 0 numeric padding to 2 digits
Set the Title field to "Untitled \v0"
else
Set the Title field to "Untitled (Remixed by \[Remixer])"
endif
|