xp-consoles/console.vbs

28 lines
823 B
Plaintext
Raw Permalink Normal View History

2021-11-11 00:48:13 +00:00
Option Explicit
On Error Resume Next
2022-10-09 21:26:11 +00:00
Sub VBSExecute(code)
2022-09-22 18:37:36 +00:00
Err.Clear
Execute "On Error Resume Next" & vbCrLf & code
2022-09-22 18:37:36 +00:00
If Err.Number <> 0 Then
2022-10-09 21:26:11 +00:00
console.error "VBScript Error " & Err.Number & " - " & Err.Source & ": " & Err.Description
2022-09-22 18:37:36 +00:00
End If
2021-11-11 00:48:13 +00:00
End Sub
2022-10-09 21:26:11 +00:00
Function VBSEval(code)
Err.Clear
VBSEval = Eval(code)
If Err.Number <> 0 Then
console.error "VBScript Error " & Err.Number & " - " & Err.Source & ": " & Err.Description
2022-09-22 20:14:19 +00:00
End If
2022-10-09 21:26:11 +00:00
End Function
2021-11-11 00:48:13 +00:00
'Auto-detect the wizard's browser extensions
2022-10-09 21:26:11 +00:00
Function InWebWizard()
2022-09-22 18:37:36 +00:00
InWebWizard = TypeName(window.external) = "INewWDEvents"
2024-05-04 01:32:37 +00:00
End Function
'Auto-detect the Windows Vista/7 sidebar gadget extensions
Function InGadget()
InGadget = TypeName(window.System) = "DispSystem" And TypeName(window.System.Gadget) = "DispGadget"
2022-10-09 21:26:11 +00:00
End Function