Preserve tested Verify source, authoritative READY checks, bounded bridge retries, diagnostics and failure-only reporting. Include 336-test suite and packaging assets; exclude live Mentor samples, field logs, backups and distributions.
30 lines
966 B
Plaintext
30 lines
966 B
Plaintext
Option Explicit
|
|
Dim app, doc, pi, licensing, token, expected
|
|
expected = WScript.Arguments(0)
|
|
Set app = GetObject(, "MGCPCB.Application")
|
|
Set doc = app.ActiveDocument
|
|
Set pi = doc.ProjectIntegration
|
|
If LCase(pi.ProjectFile) <> LCase(expected) Then
|
|
WScript.Echo "IDENTITY_MISMATCH"
|
|
WScript.Quit 2
|
|
End If
|
|
If pi.ForwardAnnotationStatus <> 2 Or pi.SynchCESStatus <> 2 Or pi.LoadCESStatus <> 2 Or pi.BackAnnotationStatus <> 2 Then
|
|
WScript.Echo "NOT_SYNCHRONIZED"
|
|
WScript.Quit 3
|
|
End If
|
|
Set licensing = CreateObject("MGCPCBAutomationLicensing.Application")
|
|
token = licensing.GetToken(doc.Validate(0))
|
|
doc.Validate token
|
|
WScript.Echo "LICENSE_OK"
|
|
If Not doc.IsSaved() Then
|
|
If Not doc.Save() Then WScript.Quit 4
|
|
End If
|
|
WScript.Echo "SAVE_OK"
|
|
If Not doc.IsSaved() Then WScript.Quit 5
|
|
WScript.Echo "IS_SAVED"
|
|
If WScript.Arguments.Count > 1 Then
|
|
WScript.Echo "CLOSE_START"
|
|
If Not doc.Close(True) Then WScript.Quit 6
|
|
WScript.Echo "CLOSE_OK"
|
|
End If
|