Move Focus to Last Macro step doesn't seem to work

Hi guys,

I’m playing around with Macros in Audacity 2.4.2. on an iMac running OSX 10.13.

My aim is to automate some fairly basic tasks by stringing together simple, repetetive ones.

I have written a basic macro to do the following:
• duplicate the selected region in the current track
• deselect the current track
• move focus to the bottom track (thereby selecting just the new duplicate, ready to perform some effect on it - and it alone)

Here’s the macro
Screen Shot 2020-08-26 at 12.59.52.png
First, try replicating those steps using the Extras:Focus menu.
Choose a project with at least two audio tracks

  1. Select all clips in the second track [I use Cmd-j, then Cmd-k - nb. is there a single macro step to do this?]
  2. Duplicate [Cmd-d]
  3. Extra:Focus:Toggle Focused Track
  4. Extra:Focus:Move Focus to Last Track

This leaves only the last track selected, with the yellow lines indicating that it is also the focused track.

Now Undo your changes to delete the new track, and try running the steps as a macro instead.
What results do you get?

For me, the Focused track is now the top track in my project (not even the track I originally duplicated).

I tried rewriting the Macro - to select no tracks, move focus to last track, then toggle focused track.
Duplicate to Bottom and Select.txt (63 Bytes)
But still the newly focused track (outlined in yellow) is the first track in the project, not the last.

Is it possible that the “Move Focus to Last Track” Macro step simply doesn’t work? (at any rate in Mac OSX 10.13)

This might help - it duplicates the track that has focus (miss out the first command to duplicate only the current selection)


Thanks, Steve.

I’m falling at the first hurdle, I’m afraid.

I don’t believe I have the Macro step to “Select Focused Track.”

Where do I find that?

I am running Audacity 2.4.2 on a Mac.

Here’s my choice of “Select” Macro steps:
Screen Shot 2020-08-26 at 16.17.59.png
(BTW, what is “Select None” supposed to do - is it identical to “Select Track: 0; 0”?)

What has been tripping me up, however, is Move Focus to Last Track (Step 3 in your example).

This does not seem to do so when I run any macro. In fact, the focus always shifts to the First Track.

It does work if I use the Menu Command - Extra:Focus:Move Focus to Last Track

Any thoughts?

I did find a long-winded way around the problem:
Screen Shot 2020-08-26 at 16.30.33.png
Macro here:
Duplicate to Bottom and Select.txt (42 Bytes)

Oops, sorry, my mistake. :blush:
That’s a little plug-in that I made because working with track focus is so awkward in Macros.

Here’s the plug-in:
select-focussed-track.ny (558 Bytes)
It is a “Nyquist Plug-in” (which is just a text file with “.ny” file extension). When installed it appears in the “Tools” menu, and is available for Macros.
Installation instructions for macOS:

“Track focus” is intended as a way to navigate tracks when selecting - particularly for blind and other non-mouse users. It was never really intended to be used in Macros.


Thanks, Steve.
I really need to get to grips with writing Nyquist, I think.

So I uploaded your macro.

Again, if I perform each step singly using the menus, then it works exactly as you’d expect.

However, if I run your nyquist tool as a single step Audacity macro, then the macro selects the FIRST track - at the top of my window.

Similarly, if I run the “Move Focus to Last Track” menu command it works;
but — if I run it as part of a single step Audacity macro, it fails - and simply selects the FIRST track - at the top.

Is this specifically a problem with Mac?

Probably not.
I wrote that plug-in for my own use, to be used in cases like your original macro, so that’s what it does :wink:

I know people are working on a release of Audacity 3, to which macros will be a welcome addition for would-be power-users who, like me, are coding dummies.

Does it make sense, then to log that as a “bug”?

If so, how do I go about it?

It would certainly be a huge help to batch processing if macro steps could reliably move between tracks - especially to the last track. As I say, I may have a way round it, but it’s jim-crack (Focus on First track - which happens regardless - followed by Move to Previous).

I don’t think so, because I’m not sure that it actually is a “bug”, at least not in the current development code - the behaviour in the current alpha version is much improved.

I think the issue here is that you are pushing the boundaries of what Macros are intended for. Macros are not intended to provide a programming language for Audacity, they are intended only as a way to create a simple linear sequence of commands - such things as:

Select -> Equalization -> Normalize -> Export

Audacity already has a full featured programming language built into it - “Nyquist”. For more ‘advanced’ scripting tasks, you need to be using Nyquist rather than just Macros, then you can do things like:

Find the average track length in a multi-track project ->
Select each track in turn and stretch the track to the average length ->
Export each track as a separate file ->
Mix the tracks ->
Normalize ->
Export the mix

(Which is impossible with a normal Macro)

I’ll make that a bit stronger (having just tested on Audacity 2.4.2): Yes it’s a bug in 2.4.2 and earlier, but it has been fixed in the current development code.


I notice you have four Debreath Macros. Would you mind sharing what they do?



Hi Mike,

sorry I missed this.

Yes. They are simply different settings for a paid-for plug-in from Waves Audio.

That plug in is very handy - especially for sung vocals - but it is quite a fiddle playing around with sensitivities (if too sensitive in a spoken audio track, consanants, etc., can be supressed; not sensitive enough, and only part of a breath is reduced - which sounds weird). It does have the advantage of fading its activities in and out by a selectable number of miliseconds.

I have set up the macros in ascending order of attack so that I can run them on a small section of audio (containing, perhaps, a single breath, or small number), duplicate it to the muted track below (in case I need to put some of the audio back), and then return to supress that section of audio.

The advantage to me of the macros is that I can suppress individual breaths or short sections to one of four degrees, quickly and smoothly with a single key-combination. Saves me a lot of faffing with Waves controls. And, if none of the macros detect a breath, I have already ‘backed up’ the audio, so I can just punch paste room tone (another single key combination) to dampen the section.

Thanks Eric - I appreciate the reply. I have the Waves De-Breath Plugin and have it setup similarly with multiple possible settings - but putting it in a Macro would make it faster.