Facebook icon Twitter icon Forward icon

Contents

Macro Scheduler 13.2.3 Update

Macro Scheduler 13.2.3 maintenance release is now available from the usual locations:

Registered Downloads | Evaluation Versions

This is a free update for users with a Macro Scheduler 13.x license.

For a list of changes see the version history here.

Links: Registered Downloads | Evaluations | New Licenses | Upgrades

Macro Scheduler on Windows 8

The new version of Windows was officially launched last week but we've been running a pre-release version for some months, allowing us time to ensure that Macro Scheduler 13.2 runs well on Windows 8.

In our initial tests we discovered that a couple of small changes were necessary and released an update (13.1.04) back in March to address these. 

So as of version 13.1.04 Macro Scheduler runs smoothly on Windows 8.  We recommend the latest release (13.2.3).   

If you own a 13.x license you can download this update for free from http://www.mjtnet.com/dldregd.htm

Video Tutorials on YouTube

We recently had some problems with the service we were using to host our video tutorials (divshare.com). Since most of them were also on YouTube we have therefore updated our YouTube channel to include all the videos and have modified our site so that the videos are now served from YouTube.

My only worry is that some companies may block YouTube, although I was also aware that some organizations also blocked divshare. So I guess you can’t win. If you are accessing our site from behind a company firewall and can’t view our videos drop us a line and we’ll see what we can do.

Finding HTML Attributes For Automating Web Sites

If you’re new to automating IE/websites with WebRecorder or the native Macro Scheduler IE functions you may be wondering how to determine which elements and attributes to use.

In this video I demonstrate how to use IE’s F12 key to invoke Developer Tools and use that to quickly find the elements we’re interested in and the attributes we need to use.

Sending/Retrieving Emails via Gmail

Since version 13.2 Macro Scheduler‘s email functions now support SSL. Google’s Gmail and many other email services now insist on SSL secured connections.

To use SSL you first need to install the OpenSSL library files.

Here’s an example of sending an email via Gmail:

Let>SMTP_AUTH=1
Let>SMTP_USERID=your_email@gmail.com
Let>SMTP_PASSWORD=your_password
Let>SMTP_PORT=465
Let>SMTP_SSL=1
SMTPSendMail>someone@somewhere.com,smtp.gmail.com,your_email@gmail.com,
             your name,test,hello world,

And to retrieve emails from Gmail via POP3 (make sure you have enabled this in your gmail settings):

Let>POP3_PORT=995
Let>POP3_SSL=1
RetrievePOP3>pop.gmail.com,your_email@gmail.com,your_password,c:\emails\in\

My Most Used RegEx

It occurred to me the other day while working on a script for a customer that I use this regular expression frequently:

(?<=TOKEN1).*?(?=TOKEN2)

It is very useful when parsing information out of web pages, or when finding elements in web pages.

What it does is pull out all the text between TOKEN1 and TOKEN2. Those could be other pieces of text, or html characters, or whatever.

As an example, recently I wrote a script which loops through all rows in an HTML table, and pulls out an order number, then looks this order number up in an Excel sheet. The order number appeared in a table cell along with other information. It was the first item inside an <i> (italics) tag and was followed by a space and then a hyphen. So I used this to pull it out of the row:

RegEx>(?<=<i>).*?(?= -),this_row,0,matches,nm,0

See how it looks for everything between the ‘<i>’ and ‘ -’ (space then hyphen).

The next thing my code needed to do was find the ID of the single input field in the same row. This input was used to enter the order quantity, obtained from the Excel sheet. The ID is not something we know up front but it’s the only input field in the row. So I did this:

RegEx>(?<=id=").*?(?="),theInput,0,matches,nm,0

In other words, pull the text between id=” and “, which gives us the input’s ID value. We can then use that later to identify and fill the input field.

Regular Expressions are daunting at first. But eventually you find a small number of patterns help in many situations. This is one that I often find useful.

What’s your oft-used regular expression? Let us know here.

Controlling Apps that Run as Admin

By now you are probably aware of UAC (User Account Control) that came along when Vista was released. And you probably know that to do anything like copy files to Windows\System32 or Program Files or do other administrative stuff you need to be running as Admin, or you’ll get the UAC prompt come up asking you for permission to continue. And when you continue the thing you launched is then running as admin.

For sensible reasons, Windows is designed so that an ordinary level process – i.e. an application that is running under a standard user account without administrative privileges (let’s call it an un-elevated application) is not allowed to manipulate, interact with or exchange information with an elevated process (one running with administrator privileges or “As Admin”).

Macro Scheduler runs “as invoker”. In other words it runs at the level of the user who starts it. In most cases, and by default, that means it is running without administrator privileges. Unless you have disabled UAC, or chosen to run Macro Scheduler as admin, or have set the Macro Scheduler shortcut properties to launch Macro Scheduler as admin, then Macro Scheduler will run as a standard user without administrative privileges.

Since a standard process is not allowed to manipulate an admin process, Macro Scheduler is not able, by default, to send keystrokes into windows belonging to processes running as admin.

Try it. Run Notepad as admin and then try the following simple macro in Macro Scheduler:

Setfocus>Untitled – Notepad
Send>Hello World

You’ll see nothing happen. The text “Hello world” will not arrive in Notepad.

Now close Notepad and run Notepad as normal and of course the script works.

So what do you do if you NEED to send keystrokes into an admin level window? Well, unless it is possible to run that process as an ordinary user you will need to also run Macro Scheduler as admin.

To run Macro Scheduler “elevated” as admin, right click on the Macro Scheduler shortcut and select “Run as Administrator”. If you have UAC enabled (the default) you’ll see the UAC confirmation box pop up to make sure you’re happy to continue. Ok that and now Macro Scheduler is running as admin.

Now try running Notepad as admin again and you’ll find our little macro works.

Some legacy applications written before Vista came along were developed assuming the user had administrative privileges, which was common in the days of XP. This was poor practice but widely done. A common transgression was that they would write their settings and files to the Program Folder. In order to run these applications under Vista or later they would therefore have to be run as Admin, unless there was any way to force them to write data to another more sensible location. Sadly there are still applications that do this, especially older ones that are no longer maintained. Since the only way to use such legacy apps on Vista/Win7/Win8 is to disable UAC or set them to run as admin and put up with the UAC prompt, if you need to automate them you’re going to have to also run Macro Scheduler (or your compiled macro) as admin.

Short version: If you wish to automate an elevated application (one that runs as admin), Macro Scheduler or your compiled macro, also needs to be running elevated.

Getting In Touch

If there is anything you need a hand with or if you'd just like to say hello please get in touch.

We love talking about Macro Scheduler and we enjoy receiving feedback and finding out how people are using our software.

You can email us, chat with us, phone us, tweet us or "Like" our Facebook page and join in with the discussion there, or meet us at the Water Cooler.  I'm also on LinkedIn.