Getting Complied Macro to run on other machines

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Lee
Newbie
Posts: 2
Joined: Fri Feb 17, 2006 4:43 am

Getting Complied Macro to run on other machines

Post by Lee » Fri Feb 17, 2006 4:51 am

We are in the middle of evaluating scripting software and I really like Macro scheduler and would like to purchase the Pro version asap. BUT, after downloading the eval in order to see if it will do what we need I am having a problem.

The basic problem is when we create a macro and compile it and then try to run it on another users machine it doesn't work correctly. The problem appears to be that MS uses cursor locations to determine which commands to run and I assume that because the screen size is different on the other machine the mouse does not line up correctly.

So what am I missing about being able to get a single exe to run correctly on any users machine ?

Lee

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

Re: Getting Complied Macro to run on other machines

Post by Marcus Tettmar » Fri Feb 17, 2006 8:02 am

Lee wrote:The basic problem is when we create a macro and compile it and then try to run it on another users machine it doesn't work correctly. The problem appears to be that MS uses cursor locations to determine which commands to run and I assume that because the screen size is different on the other machine the mouse does not line up correctly.
Macro Scheduler only does what YOU tell it to. It doesn't care a jot about cursor positions unless the script has been programmed to use them. If you have written a script that uses mouse commands - mouse clicks and mouse movements, especially absolute ones, then you can't expect the macro to work on another PC where windows are different sizes, in different positions or the screen is a different size.

If you want to make a macro generic enough to work on any target PC then you DON'T use mouse commands. If you really really must use them (in very few cases there is no alternative) then use RELATIVE mouse coordinates - MouseMoveRel).

If you want to make macros that run on any other PC then don't use the macro recorder. The macro recorder is great for simple macros and for macros that will only ever run on your PC because it can only record what happens on YOUR PC and play it back identically - played back on another PC it may not be so reliable. To make a reliable macro that works on ANY PC you need to do a bit of hand coding and build in some inteligence and use techniques that work in every scenario.

To help you get started I recommend these resources:

http://www.mjtnet.com/blog/2006/01/17/h ... on-script/
http://www.mjtnet.com/blog/2006/01/16/k ... shortcuts/

Also see Scripting Windows for Beginners in the help file or here:
http://www.mjtnet.com/OnlineHelp/index. ... uction.htm

These articles will help you understand the techniques you need to make a generic macro that will be reliable and will work in changing/different environments.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Lee
Newbie
Posts: 2
Joined: Fri Feb 17, 2006 4:43 am

Post by Lee » Fri Feb 17, 2006 12:20 pm

Marcus thank you for the quick reply and I will review the links you posted.

So far the product looks very solid and if we can get it to work in order to apply this patch to our users then it will be worth every penny. The problem is I am recommending this solution to my fellow IT guys. Even though I am a programmer they are not. So I was hoping to find a product that they could use without me having to write every macro for them.

But if they can use the macro recorder for 90% of what they need to do and I only have to tweak the script to get them to a 100% then I can live with that.

Marcus thanks again and hopefully we can get over this issue and become another success story for MJT. :D

Lee

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

Post by Marcus Tettmar » Fri Feb 17, 2006 12:30 pm

Lee wrote:But if they can use the macro recorder for 90% of what they need to do and I only have to tweak the script to get them to a 100% then I can live with that.
Yes, despite what any salesman will tell you you simply can't create a reliable, generic script without writing at least a few lines of code manually. Doesn't matter what product you use you will have to write some code yourself at some point. The macro recorder can get you started, but you will need to make some edits and, realistically, if you want to make a macro that will run on any PC, you're going to have to write it manually.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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