Book a Demo

Author Topic: Scripting - Session.Input issue with jscript  (Read 3072 times)

pal.kovacs

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Scripting - Session.Input issue with jscript
« on: September 28, 2012, 04:37:38 pm »
It seems Session.Input does not work when called from jscript. I did not see a post about that yet, so here is a workaround if you need some user input in your script.


You can invoke the 'InputBox' vbscript method like below:



function InputBox(varname,title) {
      var vb = new ActiveXObject('ScriptControl');
      vb.Language = 'VBScript';
      return vb.eval("InputBox(\"" + varname + "\", \"" + title + "\")");
}




Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Scripting - Session.Input issue with jscript
« Reply #1 on: September 28, 2012, 04:42:37 pm »
Actually, the InputBox function was only added because some systems (UAC?) prevented that ActiveX object from being created in scripting.

Just be careful, your solution may backfire.

pal.kovacs

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Scripting - Session.Input issue with jscript
« Reply #2 on: September 28, 2012, 04:51:08 pm »
Thanks, I'll test it on my colleagues' config. The actual problem is that when I call Session.Input, the line is simply ignored when I run my script.
(I tried on Windows 7 64 with UAC turned off)