Yep, the XML lives in the temporary file directory (so you better process it straightaway), and yes, the path where you end up seems pretty random (I’ve landed in both the Retrologue and Halion folders).
Either way, I spent the better part of today getting this to work. Here’s how:
Make this file called UppercaseWAVExtension.aepp and put it into “C:\ProgramData\Steinberg\Audio Export Post Process Scripts”:
<?xml version="1.0" encoding="UTF-8"?>
<AudioExportPostProcess>
<Description>Uppercase WAV extension</Description>
<Icon>CommandLine.png</Icon>
<Executable>
<Path>C:\WINDOWS\system32\cmd.exe</Path>
<Argument>/c UppercaseWAVExtension $PATH</Argument>
</Executable>
<RunOnce>true</RunOnce>
<WaitDone>true</WaitDone>
</AudioExportPostProcess>
Make this file called UppercaseWAVExtension.bat and put it anywhere that’s part of your Windows PATH environment variable so it can be found from anywhere:
@echo off
setlocal enabledelayedexpansion
set xmlFile="%~1
tidy -xml -wrap -modify -quiet %1
for /f "tokens=2 delims=><" %%a in ('type "%xmlFile%" ^| find /i "<Path>"') do (
set "filePath=%%a"
set "fileExt=!filePath:~-4!"
if /i "!fileExt!"==".wav" (
set "newPath=!filePath:.wav=.WAV!"
move "!filePath!" "!newPath!"
)
)
Lastly, download the tidy.exe XML prettifier at http://www.html-tidy.org/ (it’s in the https://github.com/htacg/tidy-html5/releases/download/5.8.0/tidy-5.8.0-win64.zip ZIP file) and put it again somewhere into your Windows PATH so the script can find it. This is necessary because Cubase makes a XML file that doesn’t contain any newline characters, making it difficult to parse, so I’m prettifying it first with this tool as part of that batch file.
That should do it - you can now select this post processing as part of your Export functionality and will end up with uppercase-extension .WAV files!
You also now have a script that deals with extracting the path out of the Cubase-generated XML file, and that will iterate through that XML file, allowing you to do whatever you want to each file. And as a bonus, you’ll end up with a more human-readable XML file as well.
All this will hopefully come in handy for others!