Run .exe and call functions

Author Message
mariopch

  • Total Posts : 2
  • Scores: 0
  • Reward points : 0
  • Joined: 12/13/2011
  • Status: offline
Run .exe and call functions Tuesday, December 13, 2011 4:41 AM (permalink)
0
Hi,
 
I'm trying to attempt the following, run a .exe program and then call commands in that program. I am able to run the program, but then it gets stuck and doesn't call the commands. I can open the program manually and then the call commands work fine.
 
Here is my script:
Set WshShell = WScript.CreateObject("WScript.Shell")Set Magnet = wshShell.Run("""C:\Program Files\Infolytica\MagNet 7.2 (64-bit)\magnet.exe""", 1)

Call getDocument().setDefaultLengthUnit("Millimeters")Magnet.getDocument().getView().setScaledToFit(True)
 
Thank you in advance!
 
-Mario
 
 
#1
    ebgreen

    • Total Posts : 8227
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: online
    Re:Run .exe and call functions Tuesday, December 13, 2011 4:46 AM (permalink)
    0
    So you can open the program manually then run a separate vbscript that will call commands in that program? I doubt that.
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      mariopch

      • Total Posts : 2
      • Scores: 0
      • Reward points : 0
      • Joined: 12/13/2011
      • Status: offline
      Re:Run .exe and call functions Wednesday, December 14, 2011 10:37 PM (permalink)
      0
      I'm just telling you what I'm able to do. Magnet, the program I use, has a feature that records and runs scripts. So once I've started Magnet I can select "run script" and choose a script I want. That works fine, but ideally I want to be able to click on the script and have it open Magnet and run the script.

      -Mario
       
      #3
        ebgreen

        • Total Posts : 8227
        • Scores: 98
        • Reward points : 0
        • Joined: 7/12/2005
        • Status: online
        Re:Run .exe and call functions Thursday, December 15, 2011 3:54 AM (permalink)
        0
        Aah, so you can use a macro within the program. This is subtly different than the impression that your original post gave. If the program exposes this in a COM API then you can do this via an external script. If not you could potentially use something like AutoIt to accomplish your goal.
        "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
        Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
        http://www.visualbasicscript.com/m_47117/tm.htm
         
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.9