Execute a VBScript inside a JavaScript
Hi there
How are you doing?
I´ve found an excellent script from IndiSnip [InDesign® Snippets] | Adobe® InDesign® Scripting Snippets
It´s a VBScript that I would like to use inside a JavaScript.
When I use it as a VBS file, everything works good, but I am not successful when I write it in JavaScript using the
app.doScript('My VBSCript line', ScriptLanguage.visualBasic);
I did it in many ways, I could not complete the script in debug mode.
Anyone could help me?
Link of script:
Get network adapter Name/MAC/Speed | IndiSnip [InDesign® Snippets]
Thanks
strComputer = "."SetobjWMIService = GetObject("winmgmts:\\"& strComputer & "\root\cimv2")
SetIPConfigSet = objWMIService.ExecQuery ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
SetobjWMI = GetObject("winmgmts:\\"& strComputer & "\root\WMI")
SetAdaptInfo = objWMI.InstancesOf("MSNdis_LinkSpeed WHERE Active = True",48)
ForEachadaptInfo in AdaptInfo
AdaptNameLink = AdaptNameLink & adaptInfo.InstanceName & vbNewLine
AdaptSpeed = AdaptSpeed & adaptInfo.NdisLinkSpeed & vbNewLine
Next
ForEachIPConfig in IPConfigSet
IfNotIsNull(IPConfig.Description) Then
AdaptName = AdaptName + IPConfig.Description & vbNewLine
EndIf
IfNotIsNull(IPConfig.MACAddress) Then
MACadd = MACadd + IPConfig.MACAddress & vbNewLine
EndIf
Next
app.scriptArgs.SetValue "myAdaptNameLink", AdaptNameLink
app.scriptArgs.SetValue "myAdaptSpeed", AdaptSpeed
app.scriptArgs.SetValue "myAdapt", AdaptName
app.scriptArgs.SetValue "myMAC", MACadd



