Is it possible to run a macro in a background window?
Moderators: Dorian (MJT support), JRL
Is it possible to run a macro in a background window?
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.
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.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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.
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!
Bob
A humble man and PROUD of it!
Re: Is it possible to run a macro in a background window?
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.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.
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
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.
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.
Maybe something like [srvany]it does mention "without the aid of a third party applications. I wonder what applications they are refering to.
Here are those dos utilities: [Download] (by right-click / Save Target As... - 93 KB)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
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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 Schedulerit does mention "without the aid of a third party applications. I wonder what applications they are refering to.
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!
Bob
A humble man and PROUD of it!
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...
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...
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
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.
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.
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]
[email protected]
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!
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!