Add Labels Macro Command

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Al Stu
Posts: 127
Joined: Thu Oct 11, 2018 8:26 pm
Operating System: Windows 8 or 8.1

Re: Add Labels Macro Command

Post by Al Stu » Mon Oct 22, 2018 5:42 am

What action will cause the added labels to be sorted?

steve
Site Admin
Posts: 80694
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Add Labels Macro Command

Post by steve » Mon Oct 22, 2018 7:36 am

Al Stu wrote:
Mon Oct 22, 2018 5:42 am
What action will cause the added labels to be sorted?
Using the Label Editor does. Probably other things too.
Al Stu wrote:
Sun Oct 21, 2018 2:44 am
Pops up dialog box, prompting for label name/text, for each AddLabel command. So in this case; 3 times.
I can reproduce this by enabling "Use dialog for the name of new label" in Preferences. If you turn that off then the labels should appear without prompting for a name. Does that work for you?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Al Stu
Posts: 127
Joined: Thu Oct 11, 2018 8:26 pm
Operating System: Windows 8 or 8.1

Re: Add Labels Macro Command

Post by Al Stu » Mon Oct 22, 2018 10:54 am

steve wrote:
Mon Oct 22, 2018 7:36 am
Al Stu wrote:
Mon Oct 22, 2018 5:42 am
What action will cause the added labels to be sorted?
Using the Label Editor does. Probably other things too.
We are talking about macros here. Why would I be using the label editor.
As for "Probably other things too". That is too vague to be of much help.
steve wrote:
Mon Oct 22, 2018 7:36 am
Al Stu wrote:
Sun Oct 21, 2018 2:44 am
Pops up dialog box, prompting for label name/text, for each AddLabel command. So in this case; 3 times.
I can reproduce this by enabling "Use dialog for the name of new label" in Preferences. If you turn that off then the labels should appear without prompting for a name. Does that work for you?
Well of course. That's why I posted about it in the Feedback & Reviews forum regarding the macro AddLabel command behavior.
viewtopic.php?f=50&t=101904

steve
Site Admin
Posts: 80694
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Add Labels Macro Command

Post by steve » Mon Oct 22, 2018 11:56 am

Al Stu wrote:
Mon Oct 22, 2018 10:54 am
As for "Probably other things too". That is too vague to be of much help.
Macros are a new feature with dozens of new commands and thousands of ways of using and combining them. I've only been testing these new features for a few weeks longer than you, plus fixing some problems as they have arisen. I can't be expected to know everything ;)

I do know that using the Label Editor re-sorts the labels, so I shared that information with you.
I also know that reversing the project and reversing it back again will re-sort the labels.
If you find any quick and convenient way to resort the labels, please let me know.

When I get time I shall be looking into this to see if sorting could be added automatically when adding a new label with a macro, without imposing too much of a performance penalty if the project contains a lot of labels. If that can't be done, then we may need an additional macro command to sort labels.
If you have better ideas, please say.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80694
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Add Labels Macro Command

Post by steve » Mon Oct 22, 2018 4:48 pm

steve wrote:
Mon Oct 22, 2018 11:56 am
When I get time I shall be looking into this to see if sorting could be added automatically when adding a new label with a macro, without imposing too much of a performance penalty if the project contains a lot of labels.
That's looking promising. Even with a project with 1000 labels, I'm not seeing any noticeable slowdown (tested on Linux).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Al Stu
Posts: 127
Joined: Thu Oct 11, 2018 8:26 pm
Operating System: Windows 8 or 8.1

Re: Add Labels Macro Command

Post by Al Stu » Mon Oct 22, 2018 7:14 pm

How about an AddLabel command option to append.

So first AddLabel is index 0, next one is at index 1, next one is at index 2, etc. Rather then each new one being at index 0, and index of all the previous being incremented.

So that new labels go after the last one, rather than before the first one.

steve
Site Admin
Posts: 80694
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Add Labels Macro Command

Post by steve » Mon Oct 22, 2018 8:11 pm

Labels "should" be kept in order in the label track so that tabbing from tab to tab goes left to right (Shift + Tab for right to left). This is important for a lot of people that use labels for navigating through large projects (such as audiobooks).

This is now fixed in the alpha code.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply