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)
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
|
|
|
|
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)
So you can open the program manually then run a separate vbscript that will call commands in that program? I doubt that.
|
|
|
|
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)
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
|
|
|
|
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)
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.
|
|
|
|