Note this reply will not appear correct in an email notification as escape sequences are removed by the mailer!
I've tried the following snippet (manually edited so that you can see all the text). The code works when run grouped but does not work when run stepwise. If one or more tracks contains the composer, all tracks which don't, will have their comment field changed and your action will terminate (Exit is executed). This means that subsequent tracks will never see the later tests.
Copy the Comments field to Variable 0
Set Variable 1 to "\ntest"
Append the Variable 1 field to Variable 0
Find all matches for regular expression "\AGeorge\ Benson\Z" in field Composer,
replace with "George\ Benson\ b\.1943" in field Composer, set state
if true
Copy the Variable 0 field to the Comments field
Clear the Variable 1 and Variable 0 fields
Exit
endif
If your action is otherwise working fine stepwise, you can solve the problem as follows:
Comment ...
Run inline action 'George Benson test' grouped
Comment ...
Start George Benson test
Copy the Comments field to Variable 0
Set Variable 1 to "\ntest"
Append the Variable 1 field to Variable 0
Find all matches for regular expression "\AGeorge\ Benson\Z" in field Composer, replace with "George\ Benson\ b\.1943" in field Composer, set state
if true
Copy the Variable 0 field to the Comments field
Clear the Variable 1 and Variable 0 fields
endif
Comment ----- End of George Benson test
or with no variables:
Comment ...
Run inline action 'George Benson test' grouped
Comment ...
Start George Benson test
Find all matches for regular expression "\AGeorge\ Benson\Z" in field Composer, replace with "George\ Benson\ b\.1943" in field Composer, set state
if true
Set the Comments field to "\[Comments]\nwhatever text you want to append"
endif
Comment ----- End of George Benson test
I don't know how many of these tests are done one at at time but the other way to go would be to create a list of the search, replace and append text and then loop through the list. This way a small number of statements could easily process hundreds of composers. You could create the list inline or you could read it from a text file. If you'd like assistance with this, I'll need your entire action. If you do, please do a Smart Export and supply a name prefix when prompted so that I can locate the components easily when imported.
|