Wavelab Script Opens random version of Wavelab

Hi there!!

I have a .vbs script that allows to open a several number of audio files and disconnect it from the master section (Ctrl-M) on a selected Tab Group, which is very useful if you need to compare your mastering with a huge number of audio files.

Basically I have taken the MP3 example and added a KeyShortcut object that executes on every instance of the loop after the wave.open instruction.

I’ve also added a WScript.Shell object just to call the AppActivate argument to ensure that the focus is in the Wavelab application and the KeyShortcut works fine.

The problem is, even if I’m calling a Wavelab7.Application, KeyShortcut or Wave object, it doesn’t opens Wavelab 7, it opens only Wavelab 9, so when I run my script, It only works for Wavelab 9, the last version I’ve installed.

I’ve been testing with some friends that also have Wavelab 7, 8.5 and 9 installed, and for each one of them opens a different version of Wavelab !!.. 7_64 bit, 8.5, 9, etc. It seems to be completely random, I could’t find a pattern or explanation for that.

It’s very important for me to open the script with a chosen version, not a random one, any suggestion?? Here’s my code:

' This script allows you to open any files and disconnect the master section (Ctrl-m)
' Just drop the audio file to open and mute
' It opens in any random Wavelab (7, 8.5 or 9) in case you have installed more than one, still looking for a reason.

if WScript.Arguments.Count = 0 then
   WScript.Echo "You need to drop an audio file on this script!..."
   WScript.Quit
end if

Dim app
Set app = CreateObject("WaveLab7.Application")

While app.IsReady() = False
	WScript.Sleep(100)
Wend

Dim ks
Set	ks = CreateObject("WaveLab7.KeyShortcut")

Dim wave
Set wave = CreateObject("WaveLab7.Wave")

Dim ObjShell :Set ObjShell = CreateObject("Wscript.Shell")
	ObjShell.AppActivate("WaveLab")

Dim i

For i = 0 to WScript.Arguments.Count - 1

	Call wave.Open(Wscript.Arguments(i))
	Call ks.Trigger("Wave", "Ctrl+M")
	
Next

Thanks a lot!!

If multiple WaveLab versions are installed, the reliable way, i think, is to use the latest one, and specify it so.
Which means, in your case:
WaveLab9.Application

Thanks Phillippe!

But I need to make it work with Wavelab 7. That’s the real trick!!

I’ve been thinking about deleting the WaveLab8_5 and Wavelab9 objects in the registry, in HKEY_CLASSES_ROOT, but I’m a bit scared about it.

One of my friends doesn’t have the Wavelab9 objects in his registry and it stills works fine. Do anyone know if this could cause some critical issues?

Thanks again!

I’ve been thinking about deleting the WaveLab8_5 and Wavelab9 objects in the registry, in HKEY_CLASSES_ROOT, but I’m a bit scared about it.

I don’t think you take a big risk with that try. And you can still save your registry settings.

I’ve tried and it doesn’t work.

Seems that there’s some kind of “connector” in Wavelab7 objects that tells windows to create and execute it with Wavelab 9 or vice versa.

Does anyone know if there’s some kind of preference in Wavelab/Windows to open the objects with a specific application?

Thanks!

It’s possible (likely?) that Windows somewhere has joined the latest WL version to the .wav file type. This should be easy to test: In explorer, click right on a .wav file, select Open With… > Choose App and then point to WL7. Hope it works!

I need to make it work with Wavelab 7.

Why 7 and not 9?

I don’t know where you got that script, and maybe it’s yours and I’m misunderstanding, but the comments at the beginning say:

’ This script allows you to open any files and disconnect the master section (Ctrl-m)
’ Just drop the audio file to open and mute
’ It opens in any random Wavelab (7, 8.5 or 9) in case you have installed more than one, still looking for a reason.

It says it opens in any random Wavelab and the author doesn’t know why. (maybe you either wrote that or saw that and want to know why too).

Maybe Arjan is right about the wav file association.

Or if it is someone else’s script, maybe contact them to see if they’ve figured it out yet.

Hi there again!!

I’ll answer in order:

Thanks Arjan! My default application for opening .wav is Wavelab 7, I have been looking for some kind of preference to make the same with the scripts and the Wavelab 7 objects but I haven’t found anything yet.

Thanks again for your interest PG!!

It’s because I need to use some Sony Soundforge’s plugins, and it doesn’t seems to work with Wavelab 9. Also the mouse wheel doesn’t work for next and previous tab in Wavelab 9, and when you need to check a huge amount of files it’s very useful. There are more small features in Wavelab 7 that make it the better solution for me by now, maybe I’m a little bit old fashioned… :slight_smile:

Sorry Bob but yes, I wrote the script myself, and yes again, I don’t know why it opens a random version of Wavelab and I’m trying to get some help about it :confused: . Sorry if maybe I don’t explain myself clearly enough !! And thanks for your participation! :wink:

I’ve been messing around my friend’s registers and I’ve found that the script opens the last version that have created objects in the register during the installation process. But if the installation have created it, even if you delete it from the register, it stills opens this version.

That’s the only clue I have found by now…

Does anyone know if there are some files that sets this “preference” in your computer when you run the installer??

I’ll keep you posted! Thanks again!!!