Welcome Guest

Pages: 1
Action to number sequentially within track Titles
jlynessPostJanuary 22, 2014, 09:50
Newbie
Posts: 23
Registered:
January 22, 2014, 14:39
Normal topicAction to number sequentially within track Titles

I am new to the more complex aspects of Action-writing. Would appreciate help or suggestions in trying to create an action to sequentially number track titles within the title text.

For example, here are 3 track titles:

Sonata #30 A major: Allegro
Sonata #30 A major: Adagio
Sonata #30 A major: Allegro vivace

I'd like the final product to look like this:

Sonata #30 A major: 1. Allegro
Sonata #30 A major: 2. Adagio
Sonata #30 A major: 3. Allegro vivace

Even better, if the Action could recognize when the numbering should re-start with different works, that would be ideal. For example, if I have the following 6 tracks, representing two 3-movement works:

Sonata #30 A major: Allegro
Sonata #30 A major: Adagio
Sonata #30 A major: Allegro vivace
Sonata #31 D minor: Vivace
Sonata #31 D minor: Andante
Sonata #31 D minor: Lento

I'd like the final to look like this:

Sonata #30 A major: 1. Allegro
Sonata #30 A major: 2. Adagio
Sonata #30 A major: 3. Allegro vivace
Sonata #31 D minor: 1. Vivace
Sonata #31 D minor: 2. Andante
Sonata #31 D minor: 3. Lento

Any suggestions appreciated!

TFL

2MR2PostJanuary 22, 2014, 12:49
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: Action to number sequentially within track Titles

Hi, try this:

http://2manyrobots.com/actions/InsertSonataSectionNumbers.zip

Unzip the file and import the plist.

The 'Insert Sonata Section Numbers' action implements your 'even better' request 🙂

It makes the following assumptions: A title must start with Sonata. A title must contain a ':'. If these conditions are not met the Title field will not be changed. Make sure your files are ordered the way you want them and that the sonatas are contiguous as the section numbers reset on a change. If your titles start with something other than 'Sonata' but still contain a ':' the action can easily be modified to remove the 'Sonata' restriction. The ':' drives the substitution...'Sonata' is merely used as a sanity check.

Enjoy.

jlynessPostJanuary 22, 2014, 17:02
Newbie
Posts: 23
Registered:
January 22, 2014, 14:39
Normal topicRe: Action to number sequentially within track Titles

this is extraordinary, how powerful Yate is! Thank you for your help.

I am studying the Action (using the Edit function) to try to understand what each step does, so I can write my own more complex Actions in the future. I confess I don't quite get each piece yet, or some of the syntax, but I'll keep thinking on it, consulting the help guide for each action, and experimenting with changes to see what they do.

2MR2PostJanuary 22, 2014, 21:00
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: Action to number sequentially within track Titles

I'm glad you like the action.

I've written up an explanation of what each statement in the action does. This might help you in understanding how it works. You can download the explanation at http://2manyrobots.com/actions/InsertSonataSectionNumbers-Explanation.rtf

While documenting the action I found a bug:

Test if the Title field contains ':' (Or result)

should be:

Test if the Title field contains ':' (And result)

You can either change it yourself or you can download the action again and import it with the Overwrite option checked.

When looking at an action in an Action editor window, double clicking on any statement in the upper right of the window will display the help for the statement in the help panel at the lower left of the window.

jlynessPostJanuary 23, 2014, 08:06
Newbie
Posts: 23
Registered:
January 22, 2014, 14:39
Normal topicRe: Action to number sequentially within track Titles

The explanation does help, thank you again.

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