diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index a414a35dd..d889fe994 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -364,6 +364,13 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project ) // prefers slightly different parenthesis characters label.Join( XO("(%s)").Format( mNames[i].GET() ), wxT(" ") ); + // Bug 2294. The Close command pulls the rug out from under + // batch processing, because it destroys the project. + // So it is UNSAFE for scripting, and therefore excluded from + // the catalog. + if (mNames[i] == "Close") + continue; + commands.push_back( { { diff --git a/src/commands/BatchEvalCommand.cpp b/src/commands/BatchEvalCommand.cpp index f11088d78..2b613b714 100644 --- a/src/commands/BatchEvalCommand.cpp +++ b/src/commands/BatchEvalCommand.cpp @@ -50,6 +50,9 @@ bool BatchEvalCommand::Apply(const CommandContext & context) // Uh oh, I need to build a catalog, expensively // Maybe it can be built in one long-lived place and shared among command // objects instead? + // The catolog though may change during a session, as it includes the + // names of macro commands - so the long-lived copy will need to + // be refreshed after macros are added/deleted. MacroCommandsCatalog catalog(&context.project); wxString macroName = GetString(wxT("MacroName"));