Legacy macro-output folder

The forum migration broke the link. I thing I’ve fixed it. Try again now.

1 Like

found a bug: if the file path contains ‘\n’ such as ‘C:\Users\nathan\music\song.mp3’, it seemingly treats it as a line break and fails to get write access.

Is there an error message?

I don’t know if this also happened in 3.0.2,
but if you try to MacroOutput a folder with an Umlaut in it, it’ll spit out errors.

The only solution is accepting the “error” for 10, 20 or 30 tracks or crashing
Audacity via Taskmanager AFAIK.


The export cannot continue.
has no write permissions.


I’m bad at coding, so I don’t know.
Will this fix something?

"(defun sanitize-file-path (path)
;;; Remove non-ASCII characters from the file path
(let ((sanitized-path “”))
(dotimes (i (length path) sanitized-path)
(let ((char (char path i)))
(if (standard-char-p char)
(setf sanitized-path (concatenate 'string sanitized-path (string char)))
(setf sanitized-path (concatenate 'string sanitized-path “_”)))))))

(defun main ()
;;; Set the macro-output folder location to the same directory
;;; as the last imported file after sanitizing the file path
(when (is-aud-version 3 0 1)
(throw 'err (format nil “Audacity 3.0.1 is not a public release.~%~
Please use Audacity 3.0.2 or later.”)))
(let (path old-path sanitized-path)
(setf path (path-from-filename (get-filename)))
(setf old-path (get-macro-output))
(unless (string-is-valid path)
; Fatal error if import file path cannot be read.
(throw 'err “Error.\nMacro-output path could not be determined.”))
(unless (string-is-valid old-path)
; If macro-export path does not exist, ensure that it is an empty string.
(format t “macro-output path not set”)
(setf old-path “”))
(unless (string= path old-path) ;skip if paths already match.
(setf sanitized-path (sanitize-file-path path))
(set-macro-output sanitized-path)))

I don’t know if this only applies to the Legacy Script, but:
If you do the Macro Batch with flac files it keeps the tags perfectly
from the old files to the new files, but if you do it with .mp3
the years and dates get fucked up.

Before conversion:

After conversion:

See these posts:

1 Like

So basically I did a dumbed down recap of your text, I guess.

I guess this is not a super urgent bug and Nyquist is super essential for Audacity
and so this issue will persist forever then?

Nyquist is a programming language for audio, and it is, in my opinion, a great asset for Audacity. I hope that the new Audacity developers continue support Nyquist in Audacity.

Regarding the “Legacy macro-output folder” plug-in: I wrote this plug-in as a stopgap workaround. There is a feature request HERE for improvements to Audacity’s built-in handling of macro output files, which, if implemented, would render this plug-in unnecessary.

1 Like

I’ve also come to realize that when I use the macro output from mp3 to mp3
has extra/strange metadata attached to the files.

Just reporting that the Legacy Macro Output Folder.ny plugin seems to be working for me using Audacity v.3.3.3 under Windows 11 Pro (2023-08-21)
Thanks to the author of this plugin.

1 Like

You’re welcome Herb :slight_smile:

1 Like

I can confirm that the plugin is broken when I upgraded to Audacity 3.4, and if there could be some help with this, I would greatly appreciate it. I use it often for work and it’s vital to my stack. Many thanks. :pray:t6:

In what way is it “broken”?
I’ve just tested it and it works as described.

Note that after installing it is necessary to restart Audacity before it becomes available in the Macro Manager.

When I run the macro from the macros palette, I get this error.

Here’s what the details are of what the error box says when I clicked it:

“timestamp”: 1699011807,
“event_id”: “42d940c4e74cc645b1dcc8e267617064”,
“platform”: “native”,
“release”: “audacity@3.4.0”,
“contexts”: {
“os”: {
“type”: “os”,
“name”: “Windows”,
“version”: “10.0.22621”
“exception”: {
“values”: [
“type”: “Internal_Error”,
“value”: “Internal error at line 1481.\nPlease inform the Audacity team at https://.”,
“mechanism”: {
“type”: “runtime_error”,
“handled”: false

Is that error repeatable? Does it happen every time with that macro?
If it does, try temporarily removing the legacy output folder command from the macro and see if the error still occurs.

Did as you instructed and the error is repeatable, with or without Legacy being in the macro. Took it out and got the exact same error message, Line 1481.

OK, so that tells us that it’s not the legacy macro-output plug-in causing the problem.

If you can post the full the macro (export it as a txt file and attach it to your post) then I’ll try running it here to see if I can reproduce the issue.

Are the files that you are processing on an internal drive? (Audacity can have problems with external/network drives or cloud storage).

Speechpad.txt (394 Bytes)

As for the files I’m processing, they’re all on an internal drive.

Ensure that the FilterCurve effect has a user Preset called “Speechpad” set up. If it hasn’t then you will need to add that preset for the macro to work correctly.

Other than that, the macro is working for me, so it looks like the “Internal error” problem lies elsewhere. My guess is that there’s a problem with one or more of the files that you are trying to process.

Ok Steve just tried the legacy output folder command in version 3.4.1 and it immediately closes Audacity. Other than the legacy output folder command I have Export Wav and Export MP3. If I remove the legacy output folder command, Audacity does not crash, but it also does not save the files in the current folder :hot_face:. Can the legacy output folder command be fixed? It worked in 3.4.0.

And by the way, still can’t send crash reports!