I am terrible at writing RegEx, hence providing my thoughts of steps-to-do here:
[Step 1] Do the following bash scripts (also executable under Microsoft PowerShell for macOS):
ls /library/audio/plug-ins/vst > ~/Desktop/vst2whitelist.txt
[Step 2] Use RegEx to process the “~/Desktop/vst2whitelist.txt” to do the following two things in order (then save):
- Recursively check every line, if not ended with “.vst” or blank line then remove the line.
- For all rest lines ended with “.vst”, remove the “.vst” string from the end of each line.
[Steps 3] Copy the vst2whitelist.txt to “/Library/Preferences/VSTAudioEngine?” folder.
For Dorico 2, the folder is “/Users/username/Library/Preferences/VSTAudioEngine2”.
P.S.: The steps above works under macOS with both Microsoft PowerShell 6.0.2 and the macOS built-in bash.
Theoretically, this trick works with Windows PowerShell and you just have to change the extensions and related directories.
Update: I finished the script for macOS bash: https://gist.github.com/ShikiSuen/a7c45ccdd653f37f73fb1eab134815ec