Book a Demo

Author Topic: Replace Seesion.Output by another console writer  (Read 2897 times)

crumble

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Replace Seesion.Output by another console writer
« on: May 16, 2019, 12:38:39 am »
Hello,
I'm executing a JScript in EA by using ScriptController from outside the application. Goal is to call a Enterprise Architect script from a C# application by previously getting the script directly from t_script database table and call it afterwards.
Usually the EA JScript user calls Session.Output to print logs to console. This can't be used from outside.
I tried to replace it by simply calling print instead, but this is not working. A COMException is called with "Object expected" as message.
Does anybody knows a way to redirect messages by replacing Session.Output by something else?
The change is done dynamically without modifying the original script content.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Replace Seesion.Output by another console writer
« Reply #1 on: May 16, 2019, 02:28:59 am »
Repository.Writeoutput

q.