Bugzilla – Bug 1859
Macros on files - Save Project causes overwrites. thus loses data
Last modified: 2018-08-20 11:46:14 UTC
Using "Save Project" in a Macro when applied to files causes overwriting of the projects as it progresses with the final result is that there is just one project and that is the last file processed. Basically the Save should be working in a similar manner to the "Export as MP3" in the supplied "MP3 Conversion" Macro - where the .mp3 file is constructed from the file name. Also there should be no user intervention needed as at step 4 to prompt for a project file location - Apply macro to Files is intended to be a batch process to be run in the background without user intervention (except in the case of error, e.g. potential overwrites).
See also Bug #1856 Applying Macros to Files is no longer a batch process
I am upgrading this to P1 - as we are rapidly approaching the scheduled release date for 2.3.0 ab we really should not be releasing functionality that can cause data loss.
DEVEL - FIX MADE https://github.com/audacity/audacity/commit/9357c90b43fe9e29127e75e94b512ad03987336a This was a quite invasive fix, and needs careful testing on one platform. Things that could go wrong include history mechanism, edits on a project after using Macros and 'Save' when the .aup file already exists. In debugging I caught and fixed a number of such issues, including ones involving orphan block files. Save in a Macro and outside a Macro now behave slightly differently.
Testing on W10 with audacity-2.3.0-alpha-70 As far as I can tell, this now seems to be working properly, with three projects properly created and no overwriting or project loss. I did get the warning advising that it's best to copy in the dependent files - but once that was acknowledged with an "always do ..." I did not get the Macro batch process interrupted again. But when I run the Steps to reproduce a second time to attempt overwriting the existing projects I get an error blocking me from overwriting the project. But note that now in 2.3.0 we now allow project overwriting with a warning - so for consistency we should allow it in macros too. In normal project saves there is no ability to hide the warning on future saves (for safety reasons) - but in Macros maybe we should allow the user to select a "do this throughout this Macro". You (James, as doer-decides) may of course decide, declare, that no overwrite in Macros is designed intended behavior - in which case I would pass this as OK
I think overwriting a .aup from within a macro without prompting is too dangerous, so I am minded not to allow it. I really WOULD want to prompt for every file, so it would interrupt a script were overwrite allowed. Someone disappointed by the behaviour could already move their existing .aup files out the way before running the macro. I do not think they are materially inconvenienced. So as doer-decides I think the current no overwriting behaviour is OK, and actually a good thing.