Export to WAV command in a Macro

Another wild guess. We don’t know if the Macro is getting stuck or just going around it. Add a harmless Macro step after the export. See if the extra step executes.

Koz

I’ve tested this macro and it works for me. However, note that it does not prompt to export the WAV file - it just exports it automatically.

I’m applying the macro to the “project”.

Got It, although it is a little confusing. It will prompt you for a file name and directory when it it is recorded in Audacity and has no file name or directory, but if it already has a file name it will direct the file to the directory you have in the macro directory settings under Preferences or to the default Audacity directory if none is listed the default directories for Macros. It would be much simpler if it would just open the Export WAV Save window or show you where it is putting the file. I’m sure the powers to be have their reasoning for this. Thanks for the answer.

Is there a way to add to the macro what folder the macro is saved in? Not by adjusting the preferences each time but having that macro save to the same folder each time. That would be nice. :slight_smile:

Yes, it’s so that you can run a macro on a batch of files and automatically process them (including exporting the processed files) without manual intervention. If you had to manually click the “Save” button on every export, then it would be impossible to just leave Audacity to run the batch and come back when it had finished (because Audacity would be stuck waiting on the first “Export”).

If you want to manually select the name and / or location for the export, just leave that step out of the macro, and when “Play” has finished, manually export (You could set a keyboard shortcut for “Export as WAV” - see: Shortcuts Preferences - Audacity Manual)

Do you mean:

  1. the same folder as the imported file?
  2. always export to one specific folder?

If you mean the former, I wrote a plug-in for that: Legacy macro-output folder

If you mean the latter, that what the “Preferences > Directories” does.

I understand the first, I was the one that started the conversation which ended with you writing that plug-in. Thanks by the way, it’s working perfect.

The files are originally on a handheld recorder. They can be moved to the desktop or the folder I want the finished file in, and the use the macro with the LegacyMacroOutputFolder at the start, then move the file from the macro-output folder to the final destination. I was thinking of streamlining the process and the macro doing the complete job. To be able to set the macro(s) to write the file to specific folders when they are used instead of having to change it in preferences each time. In the parameters, you would set the folder that particular macro would write to the final folder. Then you could have several macros with their own set of instructions and write to different folders without any further (mistakes) interaction.

Sorry, just a dream I suppose. I don’t know if this could be done and probably not worth the effort for just one request. Maybe that could be a future request. I can use the current LegacyMacroOutputFolder plug-in.

Thank you Steve for all you do to make our Audacity experience more enjoyable.
Wayne

Sorry, I seem to have skipped over this post!

This does seem like the most logical way.

You can do that with the “SetPreference:” Macro command.
The command takes two parameters:

Name="Directories/MacrosOut/Default"



Value="path-to-where-the-macro-output-folder-will-be"

For the “Value”, you must use a “fully qualified path”.
I’m on Linux and I’m not sure if, on Windows, you need to use forward slashes or double back-slashes. I think either will work.

Example:

SetPreference: Name="Directories/MacrosOut/Default" Value="C:\\Users\\FLCoast\\Desktop\\"

Thanks for the suggestion Steve, but unable to get this to work with the current macro.

Test that command on its own in a macro (just that one command in a new macro).
After running the macro, look in “Preferences > Directories” to see if the “Macro output” directory has been set.
(note that the “Value” directory must be a directory that actually exists).

SetPreference:Name=“Directories/MacrosOut/Default” Reload=“0” Value=“C:\Users\Wayne\Desktop\”

Not working

Assuming that:

  1. Your log-in name is “Wayne”
  2. You are using Audacity 3.0.3 (NOT 3.0.2 or earlier)
    Then this should work:
SetPreference:Name="Directories/MacrosOut/Default" Reload="0" Value="C:\\Users\\Wayne\\Desktop"

(Check in “Help menu > About Audacity” to ensure that you are using Audacity 3.0.3)

All of that is correct. I am using 3.0.3 64bit, although I am using the zip version with the “Portable” folder with Audacity installed on c:. All macros are in c:\ Audacity303\Portable Settings\Macros.

Please attach the file:
C:\ Audacity303\Portable Settings\audacity.cfg

Here ya’ go…

According to the audacity.cfg, it has worked as expected:

[Directories/MacrosOut]
Default=C:\\Users\\Wayne\\Desktop\\

Then where did it put it because it is certainly not on the desktop.

Ok Steve. Since this Macro command didn’t come with much of an explanation (although the name should have given me the answer) I figured out what it does. It only adds the directory location to the Default Directories field instead of having to go to Preferences and set it. That is part of what I wanted to happen.

FL Coast wrote: ↑Tue Aug 10, 2021 9:53 am
To be able to set the macro(s) to write the file to specific folders when they are used instead of having to change it in preferences each time. In the parameters, you would set the folder that particular macro would write to the final folder.

The other part was to Export to Wav the file to (Example) C:\My File\Records\My Finished File.wav without any farther intervention. Sorry for not explaining better.

Since this can’t be done, I guess it’s back to the manual export.
Man life can be so hard. :smile:. Thanks Steve, the Set Preference Macro will help.

Yes, exactly.

You said that you wanted: “To be able to set the macro(s) to write the file to specific folders when they are used instead of having to change it in preferences each time