Marcus' Macro Blog

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

Well JRL has written a script that does it:

http://www.mjtnet.com/usergroup/post36587.html#36587

Paste the code into a macro, make sure you’re sitting way back from your monitor, and run. :-)

Not that we’d condone such activity and would NEVER want to do this ourselves!

April 23rd, 2014 by Marcus Tettmar

We have today shipped maintenance build 14.1.03. Change History Here.

This build mostly fixes a few minor bugs but also has one fairly major change: We’ve replaced the application icons and system tray icon with our “Gearhead” logo ().

Why did we change the icon? Well we love that dude, and he represents what Macro Scheduler is all about!

More importantly, the main reason is consistency. As it stood the software didn’t fit with the brand image exhibited by the web site, which has become a product site pretty much dedicated to Macro Scheduler (I’d like to change the domain name to match but that’s a whole other story involving a lot of risk). It’s possible the old icons caused confusion to those who just downloaded the software from our website. In order to make the flow between website and software installation more seamless it made sense that software and website shared the same brand and therefore used the same logo.

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:

http://windows.microsoft.com/en-us/windows/end-support-help

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:

help.mjtnet.com

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.

mjtnet.com 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: http://www.mjtnet.com/snip.htm?g=533575bab6f58

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
OnEvent>KEY_DOWN,VK90,2,doExit
Let>paused=FALSE

//sample code here ...
Wait>20
MessageModal>hello

SRT>doExit
   Exit>0
END>doExit

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:

SRT>doExit
   Ask>Are you sure you want to exit?,ynExit
   If>ynExit=YES
      Exit>0
   Endif
END>doExit

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.

http://www.mjtnet.com/usergroup/subfolder-recursion-t8185.html

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