function siOnBeginSceneSaveEvent_OnEvent( in_ctxt ) Application.LogMessage "siOnBeginSceneSaveEvent_OnEvent called",siVerbose FilePath = Application.ActiveProject2.ActiveScene.filename.value splitFilePath = Split(FilePath, "\") ScnName = splitFilePath(Ubound(splitFilePath)) if ScnName <> "Untitled.scn" then TempPath = XSIUtils.Environment("TEMP") BinPath = XSIUtils.Environment("XSI_BINDIR") set FSO = CreateObject( "Scripting.FileSystemObject" ) set WshShell = CreateObject( "WScript.Shell" ) 'Run PrintVer and print result to a txt file WshShell.run "cmd /c printver.exe " & FilePath & " > " & TempPath & "\ver.txt" & """", 0, 1 'Get File Version (Read Text) GetVer = FSO.OpenTextFile(TempPath & "\ver.txt", 1).ReadLine FileVer = Right(GetVer, Len(GetVer) - InStr(GetVer, ": ") -1) FileVerMaj = Split(FileVer, ".")(0) 'Delete Text FSO.DeleteFile TempPath & "\ver.txt" 'Get App Version and Compare AppVer = Application.Version AppVerMaj = Split(AppVer, ".")(0) if AppVerMaj <> FileVerMaj then logmessage "-----------------------------------------------------" logmessage "Current Scene File Version : " & FileVer logmessage "Softimage Version : " & AppVer logmessage "-----------------------------------------------------" SaveQuestion = Msgbox ("You are going to save in a newer Softimage version." & vbNewline & vbNewline & "Are you sure?", 1 + 48, "Different Version Warning") end if if SaveQuestion = 2 then logmessage "Scene not saved - Command was cancelled.", siWarning siOnBeginSceneSaveEvent_OnEvent = True else logmessage "Scene Saved" siOnBeginSceneSaveEvent_OnEvent = False end if else siOnBeginSceneSaveEvent_OnEvent = False end if end function