Marcus' Macro Blog

Mostly tips, tutorials, articles and news about Macro Scheduler & Windows Automation
April 15th, 2014 by Marcus Tettmar

Forum user PaulSR just added this note to our long running thread Tell us how Macro Scheduler helps you, what you use it for in the forums.

We have this week gone live with a Macro Scheduler macro which allows a streamlined, accurate and timeous cancellation process to run within an insurance company. The macro collates data from a Citrix receiver application, opens and polls relevant websites for financial data then populates an Excel spreadsheet and executes some VBA macros there which allow some processing and presentation of a breakdown of figures for customers wishing to cancel a policy. The data is then returned to Macro Scheduler and it performs all the operations necessary to cancel the policy should that be the customers wish.

This was previously performed by multiple personnel as the initial agent was not skilled enough to provide the customer with accurate data at first point of contact but now that is no longer the case. I have been blown away by how empowering Macro Scheduler has been in allowing me to create something which met and exceeded the business requirements.

The macro is now in use on approximately 200 PCs and so far (3 days in) we’ve had no problems with it whatsoever.

We love hearing success stories like that. If you’ve got a story to share “>please post it to the thread.

April 11th, 2014 by Marcus Tettmar

A new article has been added to the knowledge base: Loop the Loop – all about the different ways you can create loops in Macro Scheduler.

April 10th, 2014 by Marcus Tettmar

That’s it. No more updates for XP:

Time to move on. We’re on Windows 8.1 here and quite happy with it. Apparently there’s a Start Menu coming to a Windows 8.1 update soon. Revolutionary! :-)

April 10th, 2014 by Marcus Tettmar

We now have a fancy new Knowledge Base system. Check it out at:

To get things started we’ve moved over the FAQs, the video tutorials and gone through the blog for juicy articles we think should be in the knowledge base.

This new home puts all the support resources under one roof and there’s an easy way to email support if you can’t find what you are looking for.

We’ll be adding new articles on an ongoing basis and if there’s anything you think should be included, or you have an idea for a tutorial please do not hesitate to drop us a line.

April 9th, 2014 by Marcus Tettmar

You may have heard about the OpenSSL vulnerability called Heart Bleed. If not there’s some info here. is safe!

I just wanted to let you know that our servers have been patched with the latest update and are not vulnerable. As a precaution we also reissued our SSL certificate. The company we use for e-commerce transactions – WorldPay – is also safe and secure.

March 31st, 2014 by Marcus Tettmar

Have you ever tried to send a piece of Macro Scheduler code (or any other code for that matter) to someone by email or instant messaging, or even in a forum, and found that it gets mangled? HTML strips leading spaces, characters get stripped or changed, and special characters get inserted and so on. Even when the code works it ends up looking ugly and is hard to read.

But now you can use our Code Snippets tool. You can access it via your Forum account and you’ll find it in the forum nav menu (top right of forum pages). Or go direct here (you’ll need to be logged into the forums – you can create an account for free if you don’t already have one).

Simply give your snippet a title and paste your code into the box. When you save it you’ll be given a special link which you can give to anyone, via email, forum, instant messaging, or however you like, and you can be sure that the recipient will be able to see your code, all nicely formatted and syntax highlighted. They can copy and paste it safely into a Macro Scheduler script without it being messed up, or they can view the raw file.

Here’s an example:

You’ll also get a special forum embed code. Use this if you want to paste your code into a forum post. Instead of pasting your code, paste the embed code and then when your post is viewed it will display a nicely sanitized version of your code.

Over on the right of the Code Snippets page you’ll also see a list of snippets you’ve already made. If you need to grab the link or embed code just visit a snippet page and you’ll see the link and embed code at the bottom.

So, now, if you’re sending pieces of code to our support desk via email or live chat, to a friend or colleague or in the forums, please use Code Snippets. :-)

Note that Code Snippets, as it’s name implies, is designed for small scripts and code examples. If you need to send a huge script to someone it’s probably best to send the raw script file as an attachment.

March 27th, 2014 by Marcus Tettmar

You might find that when you run a compiled macro and you also have Macro Scheduler running, Shift-Esc – the default stop key sequence – doesn’t stop the compiled macro.

This is because the stop key sequence is a system wide hot key. And system wide hot keys can only be registered for use by one application at a time. So if Macro Scheduler is already running when you start your .exe the .exe is unable to register Shift-Esc because Macro Scheduler already has it.

Of course when you deploy your .exe to people who don’t already have Macro Scheduler – which is usually the case – there won’t be any problem because Macro Scheduler won’t be running and so your .exe is able to register the Shift-Esc hot key.

But what if you want to define your own stop hot key, or you want to give your users the option of setting it? Well what you need is a KEY_DOWN event handler:

//CTRL-Z is stop key

//sample code here ...


Here we have set up a key down event handler for CTRL+Z. VK90 is Z and 2 is the modifier key for CTRL. See the OnEvent help topic and Virtual Key Codes List.

The event handler basically sets up a concurrent thread that is running all the while the main script is running. This allows it to respond to events such as this KEY_DOWN event. So when you hit the specified key sequence – in this case CTRL+Z, the doExit subroutine runs and all that does is call the Exit function which terminates the script.

You could be smarter and ask the user if he really means he wants to exit:

   Ask>Are you sure you want to exit?,ynExit

When you compile the macro there is an option to disable the standard Shift-Esc sequence. So you could do that to completely replace the stop key system with your own custom one using your OnEvent.

Consider an INI file and possibly another config script using a custom dialog to allow the user to set his own stop key sequence. Other apps could already be using it. My CTRL+Z example is probably not ideal as although it is used in Linux to suspend the current process it is usually the short cut for Undo in Windows.

March 18th, 2014 by Marcus Tettmar

Someone was asking how to get a list of subfolders. You can do that with the GetFileList command by setting GFL_TYPE to 1. That gives you the folders in the specified path. But it turns out he wanted a recursive list – i.e. one that drills down through all levels.

To do that you need a recursive function. In Macro Scheduler we can do this by making a subroutine call itself. I’ve added an example on the Scripts ‘n Tips forum. Here.

For a bit of fun go to Google and search for “recursion” and see what you get:

March 17th, 2014 by Marcus Tettmar

Macro Scheduler 14.1 is now available.

Here’s a summary of changes in Macro Scheduler 14.1:

  • New UI Automation functions for manipulating “Accessible” objects (UI Automation Elements).
  • New FindObject Wizard for locating objects, detecting accessible elements and outputting code to manipulate them.
  • Support for HTML email in SMTPSendMail
  • New HTMLViewer component for custom dialogs
  • Macro Recorder speed/reliability improvements
  • Other new functions and improvements.

The most notable addition here is the support for UI automation elements.  What’s this all about?

Well, this makes use of Microsoft’s Active Accessibility framework which allows application developers to expose UI elements to other applications.  It was originally designed to help accessibility tools like screen readers and also for automated software testing applications.

Essentially it means that the controls of applications – the UI elements such as buttons and form fields – can be more easily identified and manipulated.  Controls can be identified by name.  Here’s a short video showing this in use:

Bear in mind that what you can do with this will vary from application to application and what is possible will depend very much on what the application developer has exposed. If a developer hasn’t specifically named elements or knowingly used Accessibility, Windows will in many cases – and assuming a standard windows UI framework has been used – expose the controls anyway and will name objects based on their captions and labels.

To make it easy to identify elements we’ve added the Find Object Wizard which will show you the Accessible object beneath the cursor and let you create code to manipulate it (e.g. click it or set it’s value).  So using this you can experiment with what is possible with the application you want to automate.   Please let us know in the forums which applications you have used this with.

Assuming this new functionality proves useful, expect more features and improvements in future.

Trial Downloads | Registered Downloads | Version History

March 6th, 2014 by Marcus Tettmar

Do you know what code signing is?

Want to prevent those “unknown publisher” warnings that might pop up when you or your clients download and run your compiled macros?

Then you need a Code Signing Certificate to sign your .EXEs with.

Read on:

It’s not always when downloading files that you might get this warning. Recently a customer found a .EXE that he was launching from a reporting tool was producing this warning.  It seems the reporting tool was checking for a code signing signature.  Virus checkers including Windows 8′s SmartScreen filter will also look upon signed apps more favourably.