Macro: Save Project2: use a variable to name project

I’m new here! Thank you Audacity Team for a wonderful product!

My question:
Is it possible to use an expanded variable syntax in the “save project2” macro parameters in order to modify the Filename?

For example (which is probably wrong), would this parameter work?

maybe this one? order to expand the variables outside the string.

Macros provide a very simple way to program Audacity. A macro is just a list of commands. There are no “loops” or “conditional statements” or other features found in more complex programming languages - it’s just a list that starts with the first command and steps through the list to the end.

More complex programming requires a programming language that has more features than a macro.

Audacity includes a suitable language for more complex programming tasks, called “Nyquist”.
Nyquist is a full featured scripting language, and it can run the same commands as macros, but with much more flexibility.

Example - to export the current project to multiple files:

;type tool

(setf path "C:/Users/Fred/Desktop/")
(setf filenames (list "test1.wav" "test2.wav" "test3.wav"))

(dolist (fname filenames "Done")
  (setf fname (strcat path fname))
  (aud-do-command "Export2:" :filename fname))

For more information about Nyquist-macros:

Thank you! I’m not familiar with Nyquist prog lang. But it looks promising for my situation!

If you get stuck, we have a couple of related forum boards:
Macros & Scripting: Macros and Scripting - Audacity Forum
Nyquist: Nyquist - Audacity Forum