Is there an equivalent to CreateObject in JavaScript?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Hanchett

    Is there an equivalent to CreateObject in JavaScript?

    I want to do some Win32 application automation from JavaScript. Is it
    possible? Failing that, is there a way to execute an application from
    JavaScript?

    Paul
  • VK

    #2
    Re: Is there an equivalent to CreateObject in JavaScript?

    Not with JavaScript, but with JScript (means it will work for IE only
    and possibly for the latest NN8)

    Use ActiveXObject for that. More reading and samples:
    <http://msdn.microsoft. com/library/default.asp?url =/library/en-us/script56/html/js56jsobjactive xobject.asp>

    Sure a bunch of security limitations - read through.

    Comment

    • Martin Honnen

      #3
      Re: Is there an equivalent to CreateObject in JavaScript?



      Paul Hanchett wrote:
      [color=blue]
      > I want to do some Win32 application automation from JavaScript. Is it
      > possible? Failing that, is there a way to execute an application from
      > JavaScript?[/color]

      You can write Windows Script Host scripts in any active scripting
      language, Windows comes with VBScript and JScript (MS version of
      JavaScript) so to automate an application you simply use
      var application = WScript.CreateO bject('program. id')

      --

      Martin Honnen

      Comment

      Working...