VBScript export log

Comprehensive CAN monitor for Windows® and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
rakerley
Posts: 3
Joined: Tue 14. Feb 2012, 14:57

VBScript export log

Post by rakerley » Tue 14. Feb 2012, 15:02

Is there a way to export a log file using VBscript? I have a VBS macro that starts and saves a trace, but I want it to automatically save a log file too. Any ideas?

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: VBScript export log

Post by M.Maidhof » Wed 15. Feb 2012, 12:36

Hi,

the export of a trace file into log could not be automated by a script, because there will be some user action necessary regarding the setup of the log. This feature is not implemented in PE5 at the moment.

best regards

Michael

rakerley
Posts: 3
Joined: Tue 14. Feb 2012, 14:57

Re: VBScript export log

Post by rakerley » Thu 16. Feb 2012, 15:44

I currently have a script set up that makes the .log options window open to export a log. The options selected in this window don't change on their own, but I still need to come up and click 'Ok' or hit 'Enter'. Is there a way to send a keystroke while this window is up?

Could an ExportLog function be submitted as a feature request?

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: VBScript export log

Post by M.Maidhof » Thu 16. Feb 2012, 16:53

Hi,

ok, here is a VBmacro which will open the Export dialog and hit Enter:

Code: Select all

Sub ExportExample()
  ' Bring a tracer window into the foreground
  Dim wnd
  Set wnd = Windows("Test.trc")
  wnd.IsActive = True
  ' Give the Export dialog box some time to open
  Wait 500  
  Dim wsh
  Set wsh = CreateObject("WScript.Shell")
  ' Execute CTRL+E for File->Export...
  wsh.SendKeys "^e"
  ' ...and close the dialog box to start exporting
  wsh.SendKeys "{ENTER}"
End Sub
best regards

Michael

rakerley
Posts: 3
Joined: Tue 14. Feb 2012, 14:57

Re: VBScript export log

Post by rakerley » Thu 16. Feb 2012, 17:44

Thank you Michael, this is very helpful. This will definitely work for now, but I still think it would be advantageous to have an export command with switches for the different options.

Thanks for the prompt reply!

Post Reply