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 =
"."
Set
objWMIService = GetObject(
"winmgmts:\\"
& strComputer &
"\root\cimv2"
)
Set
IPConfigSet = objWMIService.ExecQuery (
"SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"
)
Set
objWMI = GetObject(
"winmgmts:\\"
& strComputer &
"\root\WMI"
)
Set
AdaptInfo = objWMI.InstancesOf(
"MSNdis_LinkSpeed WHERE Active = True"
,48)
For
Each
adaptInfo in AdaptInfo
AdaptNameLink = AdaptNameLink & adaptInfo.InstanceName & vbNewLine
AdaptSpeed = AdaptSpeed & adaptInfo.NdisLinkSpeed & vbNewLine
Next
For
Each
IPConfig in IPConfigSet
If
Not
IsNull(IPConfig.Description)
Then
AdaptName = AdaptName + IPConfig.Description & vbNewLine
End
If
If
Not
IsNull(IPConfig.MACAddress)
Then
MACadd = MACadd + IPConfig.MACAddress & vbNewLine
End
If
Next
app.scriptArgs.SetValue
"myAdaptNameLink"
, AdaptNameLink
app.scriptArgs.SetValue
"myAdaptSpeed"
, AdaptSpeed
app.scriptArgs.SetValue
"myAdapt"
, AdaptName
app.scriptArgs.SetValue
"myMAC"
, MACadd