Page 1 of 1

VBScript export log

Posted: Tue 14. Feb 2012, 15:02
by rakerley
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?

Re: VBScript export log

Posted: Wed 15. Feb 2012, 12:36
by M.Maidhof
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

Re: VBScript export log

Posted: Thu 16. Feb 2012, 15:44
by rakerley
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?

Re: VBScript export log

Posted: Thu 16. Feb 2012, 16:53
by M.Maidhof
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

Re: VBScript export log

Posted: Thu 16. Feb 2012, 17:44
by rakerley
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!