ktruk Report post Posted 04/01/2005 11:36 AM Hi, probably a stupid question, but what is the best way to detect the presence of a wav file before playing it, and if it is not there, play something else? I guess this needs to be VBScript, open a file object using the wav filespec, if "object is nothing" do something else, then calll vg.Play_Start() etc... A sort of: "if exists(wavA) then playit(wavA) else playIt(wavB)" Just not clear how to do this...! Any help appreciated - thx - Tim. Share this post Link to post
SupportTeam Report post Posted 04/01/2005 12:19 PM Use VBscript to run a "DIR" equivalent command on the file you want to play, and if "DIR" reports that the file is not there then play some other file. Share this post Link to post
ktruk Report post Posted 04/01/2005 12:38 PM thx - but can you be a little more explicit? I reckon I need something from FileSystemObject... Do you have anything you can just paste in here? thx - tim Share this post Link to post
ktruk Report post Posted 04/01/2005 12:54 PM Found something here... Function ReportFileStatus(filespec) Dim fso, msg Set fso = CreateObject("Scripting.FileSystemObject") If (fso.FileExists(filespec)) Then msg = filespec & " exists." Else msg = filespec & " doesn't exist." End If ReportFileStatus = msg End Function Should be able to work it out from here - thx - tim. Share this post Link to post