problem launching a program

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Tobias
Junior Coder
Posts: 22
Joined: Mon Jul 19, 2004 1:44 pm
Location: The Netherlands

problem launching a program

Post by Tobias » Tue Jul 18, 2006 7:32 am

Hi,

Another question, since my last issue was answered so quickly. ;-)

I'm trying to lauch 2 programs (in different macros), using the Run Program command. For some reason both programs won't launch properly. One changes to a different mode and the other starts up, but shuts down again (I can only see the splash screen).
I can launch both programs (using the paths from Run Program) from the Windows Run box.

Both programs are used to record media files.

Does anyone have an idea what's happening?

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jul 18, 2006 8:01 am

Odd. Run Program with the same path as what is placed in the Start/Run box will do exactly the same thing. Maybe we need to see your script. Perhaps you could post the code you are using. You could also try using ExecuteFile instead of Run Program.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Tobias
Junior Coder
Posts: 22
Joined: Mon Jul 19, 2004 1:44 pm
Location: The Netherlands

Post by Tobias » Tue Jul 18, 2006 1:16 pm

The (relevant part of the) macro looks like this:

run program>C:\Program Files\V One Multimedia\MS Video Maker\Kusu.exe
Let>PosX=0
Let>PosY=0
GetCursorPos>Mx,My
setfocus>MS Video Maker
movewindow>MS Video Maker,PosX,PosY
....

The first line is causing the problem. The part after 'run program>' works fine in the Windows Start/Run box, but not in the macro.

I am not doing any file manipulations in the macro (I use another macro to generate a video), so I don't think ExecuteFile would be suitable. (actually, I tried it and it didn't work either)

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jul 18, 2006 1:19 pm

One thing - your macro does not allow time for the application to be fully open and active before it continues. You should change it as follows:

Code: Select all

Let>RP_WAIT=2
Run Program>C:\Program Files\V One Multimedia\MS Video Maker\Kusu.exe
WaitWindowOpen>MS Video Maker
Let>PosX=0
Let>PosY=0
GetCursorPos>Mx,My
setfocus>MS Video Maker
movewindow>MS Video Maker,PosX,PosY
Not sure if that has any bearing on the issue here, but it is an important change none-the-less.

Maybe the app needs to start in it's directory first. Try this:

Code: Select all

Let>RP_WAIT=2
Change Directory>C:\Program Files\V One Multimedia\MS Video Maker
Run Program>C:\Program Files\V One Multimedia\MS Video Maker\Kusu.exe
WaitWindowOpen>MS Video Maker
Let>PosX=0
Let>PosY=0
GetCursorPos>Mx,My
setfocus>MS Video Maker
movewindow>MS Video Maker,PosX,PosY
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Tobias
Junior Coder
Posts: 22
Joined: Mon Jul 19, 2004 1:44 pm
Location: The Netherlands

Post by Tobias » Tue Jul 18, 2006 1:35 pm

Excellent suggestion, Marcus!!
Adding the 'change directory' command solved it.

thanks again!

(and, yes, I should not forget the WaitWindowOpen command)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts