Is it possible to run a macro in a background window?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Visitor

Is it possible to run a macro in a background window?

Post by Visitor » Sun Sep 12, 2004 12:27 am

I mainly use Macro Scheduler's recording tools to repeat certain repetitive tasks which involves clicking and pressing keys in a given window.

It works great for that, but the problem is that I am unable to do anything else while the script is running (since you can't have two mouse cursors!).

Is it possible at all for Macro Scheduler to issue those commands at a lower level that do not require the window to be visible to the user, and allow the user to carry other tasks at the same time?

Thanks.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Sep 12, 2004 12:52 am

Some macros can run in the background, but it depends on what they are doing. The scenario that you describe cannot be done.

Any script that has commands like Mouse, Click, Send, Dialog, Ask, Input, Press, Pixel, etc. need to have SetFocus to make them the acrtive Window for those commands. If that does not happen, then the commands will be sent to whatever happens to be the Active Window at the moment, and unplanned results will occur.

The list of commands above is not all inclusive, but just a quick list off the top of my head right now.

Scripts that do parsing/manipulation of data, file copying, reading, saving, etc. can usually be done in the background with no trouble. Backups for example could be happening in the background while work is being done with other programs.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

microplan

Re: Is it possible to run a macro in a background window?

Post by microplan » Sun Sep 12, 2004 2:52 pm

Visitor wrote:I mainly use Macro Scheduler's recording tools to repeat certain repetitive tasks which involves clicking and pressing keys in a given window.

It works great for that, but the problem is that I am unable to do anything else while the script is running (since you can't have two mouse cursors!).

Is it possible at all for Macro Scheduler to issue those commands at a lower level that do not require the window to be visible to the user, and allow the user to carry other tasks at the same time?

Thanks.
Hi - I'm not really sure (because I have not tested it with MS), but try this: install different users on your pc, one named "MacroSceduler". This user must have all the rights to execute the desired macros and all programs which are required for the macro execution must be installed for this user. This separate user has its completly different desktop ! Install MS for this user and setup the tasks.
Under WinXP you have the opportunity to simply "switch" between users (via logout procedure), so you can switch/login to your personal desktop/virtual machine without(important !!!) stopping the background user "MacroScheduler". Usually, you should not be affected by the windows and activity which only appear for the background user "MacroSCheduler" when you are logged in into your personal users account.
Hope, this helps.
Klaus

Visitor

Post by Visitor » Mon Sep 13, 2004 11:04 pm

Umm, that doesn't seem to work.
The FAQ does say that Macro Scheduler cannot run as a service. And hence will not run if the user is logged out.
http://www.mjtnet.com/index.mv?msfaq6.html

However, it does mention "without the aid of a third party applications. I wonder what applications they are refering to.

Lumumba

Post by Lumumba » Tue Sep 14, 2004 8:53 am

it does mention "without the aid of a third party applications. I wonder what applications they are refering to.
Maybe something like [srvany] 8)
Included in utilities.zip are:

addusers.exe
Can be used to Add, Update, or Delete Windows NT/2000/XP users on local computer or domain.

blat.exe
Can be used to send out emails via SMTP

elogdmp.exe
Windows NT/2000/XP Event Log Query Tool for local and remote PC's. Can export Event Logs to a text file for parsing.

reg.exe
Registry utility that lets you almost do anything to local and remote PC Registries.

rkill.exe & rkillsrv.exe
Remotely Kill processes by name, or PID.

sc.exe
Utility to Add, Update, Delete, Configure, Start, Stop, and Pause Windows Services.

srvany.exe
Utility to run any application as a service.


provided by beardboy in the AutoHotkey forum
Here are those dos utilities: [Download] (by right-click / Save Target As... - 93 KB)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Sep 14, 2004 4:25 pm

it does mention "without the aid of a third party applications. I wonder what applications they are refering to.
I recently replied to another question and wrote up a description of how I use pcAnyWhere to log in to a system to run Macro Scheduler

The link is here: http://www.mjtnet.com/forum/viewtopic.php?t=993
Look at the posting by me on Sept 10, at 1:33

It may be possible for you to modify that process somehow. This runs for me every night to run maintenance routines on a logged out computer. You may be able to use any other remote access tools instead of pcAnyWhere.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Visitor

Post by Visitor » Wed Sep 15, 2004 5:17 am

Thanks for the replies.
I've tried running Macro Scheduler as a service (under another account I setup) but its still able to do any clicking/typing etc.

As soon as I log out of that user, the macro just seems to sit there.

I am going to have a closer look at Bob's solution and see if it applies to me.. I didn't expect this to be so unfeasible (by no mean easy - but not impossible). I thought that once the Macro Scheduler knows which windows and the coordinates-input, it would be possible to mimic such commands directly into the OS. And if that wasn't possible, then at least this work around would've worked.
Ah well, can't blame Macro Scheduler. I've looked at other macroing applications (getting desperate here - I've been using Macro Scheduler the longest, so I'd rather stick to it if I can since I am starting to learn how to write scripts with it), but so far, no luck either...

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Sep 15, 2004 5:37 am

:idea: Request to this visitor, perhaps register with a name so we can keep the discussions clear and know who is actually responding :?:
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Ax
Newbie
Posts: 9
Joined: Wed Oct 06, 2004 5:28 pm

Post by Ax » Wed Oct 06, 2004 5:31 pm

All "Visitor" replies were mine (at least the ones in the Beginners and Scripting forum).
And I've now registered :)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Oct 06, 2004 5:55 pm

Welcome back Ax.

And have you solved your problem? What is the current status?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Ax
Newbie
Posts: 9
Joined: Wed Oct 06, 2004 5:28 pm

Post by Ax » Wed Oct 06, 2004 9:44 pm

Thanks Bob :)

To be honest, I gave up. Getting this to work would allow me to multi-task better. I have tried another Macro application, with similar results.

microplan's suggestion sounded good (I can't really think of a way to have the application interact with a window while I am typing a document on Word at the same time), but it appears to me that all keyboard and mouse movements stop responding as soon as you log as another user. Setting up Macro Scheduler as a service seemed like the only way that might've solved the problem.. But that didn't work either.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Oct 06, 2004 10:16 pm

What you want to do is impossible I'm afraid. Macro tools work by simulating what a user does. That's the only way. They therefore need to use the computer in the same way that a user does. They therefore have to have complete control over the keyboard/mouse and windows console. Running as a service is no good because the service doesn't have access to the console and windows do not exist to it. And in the same way that you can't realistically have two people try to use the same computer, so you can't interract with Windows while another process - the macro - is also trying to do so.
MJT Net Support
[email protected]

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Fri Oct 08, 2004 5:01 pm

Hi Ax,

Your inquisitive exploration of Macro Scheduler's technical limitation comes up once every year. A similar topic was discussed last year (http://www.mjtnet.com/usergroup/posting ... ply&t=1118). IMHO, Macro scheduler wasn't designed wtih a virtual keyboard and a virtual mouse in mind. Being a commercial product for mass market, it can't be too theorectical and academical. Intellectually, your idea is bold. Were you in the shoes of coporations, you won't spend a penny in the product you suggest because of high security risk.

Now it becomes my basic instinct--whenever one or more Macro Scheduler scripts are running, I never touch my keyboard. In return, Macro Scheduler saves me time and boosts my productivity. What a romantic relationship!

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