Welcome Guest

Pages: 1
Ok, What did I do wrong (second attempt)
LouisMackey111PostJune 21, 2016, 14:09
Newbie
Posts: 14
Registered:
November 8, 2014, 19:45
Normal topicOk, What did I do wrong (second attempt)

Ok let try this again.

I have a series of (sub) actions that will add/update or otherwise change the composers field more to my liking and maybe add some info to the comments field about that composer. See the attached Screen Shot For how its set up. It has been working up to now, but now when I add a new composer with comments, the composer field is updated by the comments field is not, in addition anything in the comments field at the start of the action is wiped out.

Also, this only seems to occur with additional (new) composers, all the one entered before this started seem to work/update fine.
have I hit some limit or ?

Yate version 3.12(5014) running on Mac OS X 10.11.5 El Capt.

Thanks
Louis Mackey
Image

2MR2PostJune 21, 2016, 14:32
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Ok, What did I do wrong (second attempt)

There are no limits in Yate.

I can't see the destination on the Regular Expression statement (I'm assuming composer) nor can I see if you selected 'Set state'. Also I cannot see if you are executing grouped or stepwise. The snippet will more than likely not work if you are running stepwise (unless each track has the same composer information). The action test state returned from from the Regular Expression statement will be true if changes were made for any file.

Please send me the action or a code snippet (you can drag and drop from one AE window to another). In the action manager, highlight the action or created-snippet and do an Export. Send it to support@2manyrobots.com and I'll take a look.

2MR2PostJune 21, 2016, 15:07
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Ok, What did I do wrong (second attempt)

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.

2MR2PostJune 21, 2016, 16:42
Avatar photo
Administrator
Posts: 2085
Registered:
August 23, 2012, 19:27
Normal topicRe: Ok, What did I do wrong (second attempt)

I've uploaded a sample action to illustrate how you can loop to test all the data possibilities. I've did not use Regular Expressions as your regex was anchored at the start and end.

You can download the sample at:

https://2manyrobots.com/actions/SampleUseOfDataToDriveComposer-CommentsChanges.zip

The bulk of the action is documentation and some sanity checks to ensure that the data was entered correctly.

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