1181
VB and the development of wizards / Re: SendKeys ???
« on: September 05, 2011, 03:38:06 AM »Do you get your "hardware" working ok??? ANy plans for a serial interface??Yes thanks - works a treat - modbus setup/monitor interface at the moment, looking at direct serial as well.
Ian a question, Is it possible to pass a variable from the M1s script to the VBS script.Yes - the simplest way is probably un-named args. Just push command line arguments separated by spaces and pop them with the arguments method.
Code: [Select]
'**M1S Script
Set oShell=CreateObject ("WScript.Shell")
'any preamble code here
oShell.run "C:\TP.vbs " & GetOemdro(123) 'push the value of DRO
NotifyPlugins(12345) ' Open Plugin window
Set oShell = Nothing
Code: [Select]
'**VBS Script
set oShell = WScript.CreateObject("WScript.Shell")
Set args = WScript.Arguments
WScript.Sleep 5000 'wait 5 secs then do the sendkeys
oShell.sendkeys args.Item(0) 'Send command line args(0) value
WScript.Sleep 1000
oShell.sendkeys "{ENTER}"
Cheers
Ian