Compiled Script makes takes control

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Compiled Script makes takes control

Post by kpassaur » Wed Jun 13, 2018 3:18 pm

I have always had issues with compiled scripts that run in the background. What happens is they take control and render the machine useless for a bit. For instance I have one running now that executes a program every 10 seconds. The program checks for files in a folder and processes them. Since I have started writing this I have had to stop at least 10 times. Before I used to run them as command line programs with cmd /c and it was an issue sometimes now it is a nightmare.

In the past I would change to the directory first and then execute the program with the cmd /c now, I use RunProgram and put the entire path to the compiled script in. I do that because sometimes something would take control and it would not be in the folder to execute the program.

Also, when I execute a compiled script it changes which windows have focus.

This has taken me about minutes to write because I lost focus so much. Is there a switch somewhere so it actually runs in the background.

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

Re: Compiled Script makes takes control

Post by Marcus Tettmar » Fri Jun 15, 2018 10:29 pm

Hard to comment out without knowing what your .exe does. If it pops up a UI then clearly it's going to steal focus. Have you tried starting it with the -HIDE parameter?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Re: Compiled Script makes takes control

Post by kpassaur » Sat Jun 16, 2018 10:17 am

Only one that I call has a GI. When I run it I use LET>RO_WINDOWMODE=0. I use - HIDE when I compile the Macro. Most of my Macros consist of one that opens a dialog that has a settings, help, run and exit option. The run option triggers a compiles macro that activates command line programs. The program that it calls that gives me the most trouble with stealing focus is MODI (Microsoft Office Document Imaging).

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