Marcus' Macro Blog

Tips and News on Macro Recording and Automating Windows with Macro Scheduler
November 21st, 2014 by Marcus Tettmar

When robots get it wrong:

November 18th, 2014 by Marcus Tettmar

When you run code in the Script Editor you are in fact running it inside a debugger.

This allows you to run code line by line or in chunks, and evaluate the values of your script variables in the watch list as you go.

By default – after a first install – the debugger always runs scripts from the top – the very first line. Just as would happen if you run the script some other way. From top to bottom.

But when you are debugging a script you often want to run a select number of lines or start debugging from a different line. So, to do this, you can disable “Run From Top”. This option is under the Tools menu.

When “Run From Top” is disabled the macro will start from whichever is the current line – i.e. whichever line currently has the cursor on it.

Recently in the forums two different people have had seemingly strange issues with scripts which turned out simply to be because they had this option turned off and weren’t running from the top. In both cases they were getting errors because some variables they were referencing hadn’t yet been created! The script had been started from a point after the variables were set.

So, when running in the editor, if you’ve previously disabled “Run From Top”, and you want to run the script as normal, either reset this option or put the cursor on the first line before running.

And if you see some seemingly strange behaviour which goes away when you run the script outside of the editor – it’s probably just because you haven’t run the script from the top!

For more info on how to use the debugger please see:

November 17th, 2014 by Marcus Tettmar
November 12th, 2014 by Marcus Tettmar

With our MacroScript SDK you can add the ability to run Macro Scheduler code right inside your own applications.

The SDK lets you run Macro Scheduler scripts and code, as well as query Macro Scheduler script variables during code execution. The SDK gives you a more seamless way to run Macro Scheduler code and use Macro Scheduler capabilities within your own applications.

Back in 2012 Steen Jakobsen of DM Software integrated the SDK into their Dialog Manager software. He kindly agreed to a case study.

Macro Scheduler made it very easy to integrate the SDK. The input parameters for the scripts are completely integrated and direct, and secure and reliable data transfer is being accomplished – all thanks to the brilliant architecture of the MacroScript SDK. …. We’ve saved the doctors and nurses enormous amounts of time, and at the same time, added very valuable and sophisticated calculation and decision support across five systems that otherwise have no link to one another. This can only be done with the unique Windows automation capabilities of Macro Scheduler combined with the tight integration with Dialog Manager.

Steen Jakobsen, DM Software

Read the Case Study here.

November 7th, 2014 by Marcus Tettmar

I am pleased to announce that we have today released Macro Scheduler 14.2

Amongst other things this new version includes the following great new features:

  • Self Documenting Macro Recorder with snapshots of Windows/Objects being Activated/Clicked on
  • The ability to run Python code within your macros!
  • A native JSON Parser
  • A native XML Parser using XPath

Here’s an overview of these main new features, but for a more complete list of improvements view the history list here.

Self Documenting Macro Recorder

Ever recorded a macro and then tried to edit it but couldn’t figure out which bit did what? Well, now when you record a macro the macro recorder will take snapshots of windows that are activated and objects that you click on. These will be inserted into the script as image comments, right above the line of code they refer to. So, now, it’s easier to see exactly what your macro is doing and which bits you want to edit/copy.

Run Python Code Inside your Macros

In 14.2 there’s a new function called PyExec. It allows you to run real Python code and get back the values of any Python variables you specify. You’ll need to install the Python 2.7 DLL to your Macro Scheduler folder (or compiled .EXE folder) – there’s a link in the help file to a zip file with all the files you need.

You can run any Python code and even use third party Python imports. This is pretty wild IMO – the possibilities are endless. Here’s a simple example:

First ensure Python27.dll and imports are in your Macro Scheduler program folder.
Download and unzip this file:




import urllib2
import json

# grab data from - see
response = urllib2.urlopen('%url%')

# load the json
dict = json.loads(

# get the ip member
myip = dict["ip"]

# make a nice string representation of the dict
sdict = json.dumps(dict)

# Anything we print to IO is returned in the PYExec output var
print "All Done"

//Load the Python code to a variable

//Run the code and request the values of the sdict and myip variables ...

//Display the IP address
MessageModal>Your pubic IP is: %myip%

Parsing JSON

In the last few years JSON has become a very popular way to transmit data objects. Most web services now use it so it cannot be ignored. While you can parse JSON using string handling/regex having an easy to use native parser is essential. Enter: JSONParse

In the above Python example we used Python’s own JSON handling to extract an IP address from some JSON retrieved from a web service. Here’s how we can do the exact same thing using native MacroScript code:

MessageModal>Your pubic IP is: %myIP%

And here’s an example which gets data out of a more complicated structure:

//Requires Macro Scheduler 14.2

{ "uid" : "1234",
  "clients" : ["client1","client2","client3"],
  "people" : [{"Name":"Marcus","Age":"21"},{"Name":"Dorian","Age":"18"}],
  "color" : "red",
  "size" : 14 }



Parsing XML

Of course XML is also still very popular. Up til now we’ve had to parse XML using substring handling/regex or use Microsoft’s XML object via VBScript – which is a little over-complicated IMO. We now have a simple to use native XML parser function – XMLParse. Here’s an example:

//Requires Macro Scheduler 14.2


<?xml version="1.0" encoding="UTF-8"?>

  Everyday Italian
  Giada De Laurentiis

  Harry Potter
  J K. Rowling

  XQuery Kick Start
  James McGovern
  Per Bothner
  Kurt Cagle
  James Linn
  Vaidyanathan Nagarajan

  Learning XML
  Erik T. Ray


How to Download/Upgrade

If you have a valid maintenance plan you can download the update from your account here. If your maintenance has lapsed you can also purchase upgrades and renew maintenance from within your account.

Trial versions can be downloaded here.

October 30th, 2014 by Marcus Tettmar

Following on from my last post with some examples of using the MacroScript SDK within Python I thought I’d post a simple C# and C++ example. These are the same examples that ship with the MacroScript SDK:



More info on the MacroScript SDK is here.

October 18th, 2014 by Marcus Tettmar

If you have kids here’s a great way to show them how to do long multiplication. They’ll love this:

October 16th, 2014 by Marcus Tettmar

Our servers have been patched for Poodle, the SSL3 vulnerability. Basically we’ve just disabled SSL3 and SSL2. These are no longer needed anyway as all modern browsers support their successor, TLS.

Those using IE7 or lower (why oh why!?) will, by default, not be able to load without making a small change.

If for some unearthly reason (there really isn’t one) you HAVE to use one of those ancient browsers you can simply go into advanced settings, disable SSL2 and SSL3 and enable TLS 1.0.

But why bother doing that when you can just upgrade. Even those of you stuck using XP can upgrade to IE8 (or use a better alternative).

But if you need to do that you won’t be reading this unless you’ve connected via a different browser/PC!

According to our server logs 3% of visitors last month were using IE7 or less. That’s a low enough figure not to worry about lost visits and, anyway, it’s time these browsers and SSL3 were consigned to the scrap heap once and for all. Any other workarounds or fixes are just delaying the inevitable.

21% of visitors are still using IE8. They’re probably stuck on XP. I can’t wait to see that figure drop below 1%.

October 15th, 2014 by Marcus Tettmar

On October 25th MJT Net employee Dorian Ellis is taking part in a 24 hour gaming marathon to raise money for Doernbecher Children’s Hospital, a hospital local to Dorian which has treated children of friends of his.

When Dorian isn’t answering Macro Scheduler support tickets he’s often to be found playing on-line games, so this fundraiser combines his passion with a cause close to his heart.

Please check out his page and, if you can, make a small donation and let’s see if we can help Dorian reach his target of $1000. Thank you.

October 14th, 2014 by Marcus Tettmar

Did you know there was a Macro Scheduler SDK? It allows you to run Macro Scheduler code from right within your own apps. You can run and interact with MacroScript code within VB, C++, C#, Delphi, VBScript … or any other programming language which lets you use a COM object or Win native DLL.

It even works in Python. Here’s a small example which uses the screen image recognition functionality to find and click on the Windows Start button:

Another slightly more complex example which opens Notepad and types into it. It also demonstrates how you can call chunks of code at a time instead of all at once and set and get the value of script variables during execution. It also gets the result of the script set via MACRO_RESULT:

More information about the MacroScript SDK can be found here.

A number of customers have used the SDK to build macro-ing capabilities into their own products and/or create tighter integrations between their own software and automation routines using MacroScript.

If you’re interested in trialling a copy or getting pricing info drop us a line.

    • Archives

  • Categories