November 18, 2007

Application and System Monitoring

Filed under: Automation, Scripting — Marcus Tettmar @ 9:30 pm

A short roundup of resources and ideas for using Macro Scheduler for system and software monitoring.

Event Log Monitoring

Here’s a tip showing how to create a script to monitor event log messages:
http://www.mjtnet.com/usergroup/viewtopic.php?t=4256

Process/Service Monitoring

This script demonstrates a function called IsProcessRunning to check if a specific process is running. Use it to create a monitor to watch a specific application process and make sure it is running. It could send an email if the process is no longer running. The same script shows some code to get the status of a service which could be used to create a service monitor.

Monitoring Files

Macro Scheduler has built in functions to see if a file exists, get file lists, get file dates, see if a file has changed, read from text files, read from INI files and more. See the IfFileExists, ReadFile, ReadLn, GetFileList, FileDate and ReadIniFile commands in the help file.

Monitoring Web/Intranet Resources

Use HTTPRequest to retrieve data from web resources, or FTPGetFile to download a file from an FTP server. Monitor email with ReceivePOP3.

Monitoring Windows and User Interfaces

If you just want to check that a window exists use IfWindowOpen. GetActiveWindow will return the active window title. Maybe you need an alert when a window contains a specific message, or piece of text. GetWindowText will retrieve all detectable text in a Window. Use GetControlText to retrieve text from a given control class and instance.

But what if you need to monitor a graphical element, or look for some non-detectable text? Use FindImagePos. The Image Recognition functions mean any kind of user interface can be monitored and/or controlled. You can also monitor applications running remotely (e.g. in Windows Terminal Server or Citrix sessions, or even non-Windows VNC apps) or in virtual environments.

One of our customers provides hosted software solutions to clients who require a high degree of up-time. Their clients’ businesses depend on their software remaining online. So they have used AppNavigator to create UI monitors that watch their applications and alert them if an interface goes down.

Alerts

The Event Log monitor example above uses email to alert the system administrator when an event is detected. Email is probably the most common method. Email can also often be used to send an SMS message (check with your mobile carrier). But an alert could just be a message box popup, or the script could run another application, write to a file or database or call a web resource. Pretty much any kind of alert could be created.

Have you used Macro Scheduler for system monitoring? If you have an example or story to share, please post a comment.

November 1, 2007

“Live” Flowcharts that Automate – MacroScript Workflow Designer

Filed under: Announcements — Marcus Tettmar @ 2:35 pm

Workflow Designer I am pleased to announce our latest product, MacroScript Workflow Designer. With Workflow Designer you can create graphical workflows and add MacroScript (Macro Scheduler) code to actions and decisions. So you can draw flowcharts that actually work!

The Workflow Designer is a great way to manage and organise large collections of interconnecting macros. Actions and Decisions can run existing Macro Scheduler scripts, other executables, or even embedded code.

Moving code around is now as simple as drag-and-drop. Creating a loop is just a case of connecting an action with a previous one. Define logical flows through a process by inserting Decisions wherever they are needed. Workflow Designer simplifies the modeling of complex business processes as well as making management of smaller tasks easier.

Get more information here. You can watch a simple video demo here.

MacroScript Workflow Designer is currently free with Macro Scheduler Pro Enterprise 10 and 25 Packs.

October 26, 2007

Version Control for your Scripts

Filed under: General — Marcus Tettmar @ 1:35 pm

If you work regularly on large macro files you should consider using a version control system. Remember that time when you made a few small changes to that 2000 line macro and it stopped working and you spent ages trying to figure out what you did and get it working again, losing a lot of hair in the process? Ok, so you had a backup right? But what if you needed to get back to a version from before the backup – and quick?

Macro Scheduler’s advanced editor gives you a “Backup on Save” option. This keeps the last three copies of each script each time you save. If you look in the script’s folder you will see a .001, .002 and .003 file as well as the main .scp file.

But you may want more control than this. You might want to look at the code as it was three months ago. And if you distribute compiled macros to clients you may need complete version control. With a version control system you can create branches from your main code. Let’s say you create a utility which you sell to your clients. When you release version 2.0 you might still want to support version 1.0. If a customer using version 1.0 finds a bug you need to fix that bug in the version 1.0 code without them having to upgrade to 2.0. Or you may create customisations for different clients. A client may need some changes but you don’t want those changes in the main code base. Or perhaps you have more than one person working on your script files and you need a way to keep your changes in sync.

With a Version Control System you “check” files in and out of the “repository”. So when you’ve done making changes to a script you can “check” it in. The VCS adds this change as a new version. Later you can check it out. Normally you’d work on the “HEAD” – the most up to date version. But if you need to go back to a previous version you can choose to check out a different version. You can see all the versions in the repository. When you check a file in you would normally write a short note as you do so, so you know what changes you made. So by using a version control system you have a complete track of all the changes you ever made, and you can get back to a previous version easily and safely.

This is when you need a version control system. We use TortoiseSVN here to manage the Macro Scheduler source code. You could use it for your Macro Scheduler script files too. In fact you can use version control for pretty much any kind of files you work on regularly.

You can find our more about TortoiseSVN here: http://tortoisesvn.net

TortoiseSVN integrates directly with Windows Explorer. It’s really easy to check files in and out just by using Windows Explorer. The help file that comes with TortoiseSVN is helpful with a good introduction if you’re a newbie, and provides some tips on how to set up your repository.

If you’re new to version control here’s a really nice visual guide:
http://betterexplained.com/articles/a-visual-guide-to-version-control/

For those of you who work regularly on large script files for multiple clients – and I know a number of you do – you should think seriously about using source control.

October 23, 2007

Kaspersky Internet Suite 7 Slows Macro Scheduler Down

Filed under: General — Marcus Tettmar @ 10:53 am

A customer just reported this issue:

http://www.mjtnet.com/usergroup/viewtopic.php?p=17969

Seems Kaspersky must be intercepting emulated keystrokes and is slowing their progress. I’ve emailed Kaspersky to ask for a resolution. Until then if you are running Kaspersky Internet Suite you need to close it down completely to prevent this issue.

Quite rightly you should be running a security solution. We run AVG Antivirus and Webroot Spy Sweeper on our machines here. Neither affect Macro Scheduler in any way.

October 16, 2007

What’s in a Name?

Filed under: General — Marcus Tettmar @ 4:10 pm

Sometimes I wonder if Macro Scheduler has outgrown its name. “Macro” seems too small a word, and “Scheduler” is just one small feature. It’s so much more than these two words suggest now.

When version one was released there were less than 20 commands, purely for simulating user input and manipulating windows. No script editor, just a drop down list to select the few commands you needed. And a scheduler. Macro Scheduler was the perfect name. People used it to write macros and schedule them.

Fast forward ten years and Macro Scheduler’s script language, which we call MacroScript, is now vast, with all kinds of functions, looping constructs, conditional statements, subroutines, internet functions, etc. It has a dialog designer for creating user interfaces, embedded VBScript, see-screen image recognition, a debugger, DLL functions you can use to run functions in custom DLLs and Windows API functions, and a full featured editor. There really is nothing it cannot automate. I know people who have created routines over 5000 lines long. The emphasis now must surely be on the word “automation”. But at the same time it has got easier to use.

One feels the word Macro just doesn’t do these capabilities justice. I also wonder if first time visitors might initially make the mistake of comparing Macro Scheduler to other products which are more basic.

But what’s the solution? Change the name? I’m loathe to do that for a number of reasons. There’s ten years of history, loyalty, word of mouth and Google-juice in the name “Macro Scheduler”. No way should we drop the name altogether. Or maybe we should leave Macro Scheduler where it is but start a new branch of the product with a new name? I don’t know. I do know that the word macro is searched for on Google many many times more than the word automate. So perhaps we should leave things be? I also know that Macro Scheduler is a very capable product and we want people to realise that. I don’t want the name putting anyone off.

The other day I was talking to someone at one of the largest utility companies in the USA. She told me that her IT department uses HP’s WinRunner product for automation but they were unable to get it to automate one particular piece of software. WinRunner costs thousands of dollars. She found Macro Scheduler and was very quickly able to use it to automate this tricky application. Other customers report similar stories. Well I guess the name didn’t matter in this case. She found our product and it proved itself.

So does the name matter?

WebRecorder 2.0 Released

Filed under: Announcements — Marcus Tettmar @ 3:07 pm

This version uses Macro Scheduler 9.2’s DLL import method. It installs the DLL into Macro Scheduler 9.2’s folder and creates native looking functions instead of LibFunc calls. Much easier to read. Also much easier to edit. Of course, you can switch back to using LibFunc calls if you need/prefer to.

WebRecorder 2.0 also has an ExtractTable function so that you can easily extract HTML tables to CSV files.

Some slight user interface updates also, such as close buttons on the browser tabs.

WebRecorder| Downloads | Registered Updates

October 12, 2007

Macro Scheduler 9.2 Released

Filed under: Announcements — Marcus Tettmar @ 10:48 am

I’ve just made Macro Scheduler 9.2 available.

  • Mod: FindImagePos: Can now use SCREEN in haystack parm to have it scan the screen directly (no need to capture the screen to a file first)
  • Added IGNOREERRORS option to prevent script error popups
  • Added ability to change log file viewer in registry from default notepad (Set HKCU\Software\MJTNET\MSched – LogViewer)
  • Added DLL import system to define native looking functions rather than have to use LibFunc (Documentation on request. Will be used by WebRecorder 2.0).
  • Fixed: Rounding error in CompareBitmaps could yield incorrect result if images more than 99% similar
  • Fixed: Errors downloading from some FTP server types with FTPGetFile
  • Improved: View System Windows follows correct tree hierarchy
  • Added: View System Windows “Identify” option – highlights object

This is a kind of bonus release in a way. We were going to wait for version 10 for some of these features but for various reasons wanted to get them out there now. One is so that we can release WebRecorder 2.0 which will use the DLL import system. Makes for code that is easier to read rather than all those LibFunc calls. The ability to specify SCREEN in the FindImagePos command instead of a bitmap file also makes it easier to write code to scan the screen for an image – there’s now no need to use ScreenCapture first.

Macro Scheduler | Download Evaluation | Registered Updates

October 8, 2007

Screen OCR to Retrieve Otherwise Undetectable Text

Filed under: Automation, Scripting — Marcus Tettmar @ 7:56 am

Some while ago I wrote this post about how to script a tool called Textract to perform OCR against the screen. Well gpulawski has just posted this tip in the forums pointing out that Microsoft Office 2003/2007 comes with something called MODI (Microsoft Office Document Imaging) which can OCR a bitmap or TIFF file and is scriptable. Very cool.

We can use MODI transparently in a Macro Scheduler script to use OCR to extract text from a Window. I’ve posted an example here.

This is really useful if you have a window that doesn’t expose text as text objects and you can’t get at the text any other way (e.g. via the clipboard or controls). You may want to check for the existence of a certain string in a window, or wait for a particular word or phrase to appear in order to determine when a process has completed. If the control doesn’t expose the text and the text cannot be copied to the clipboard, OCR may be the solution.

October 4, 2007

September 30, 2007

Excessive Packaging

Filed under: General — Marcus Tettmar @ 6:18 pm

What is it with the packaging you get computer stuff in?

Excessive Packaging

This is that horrible thick plastic stuff. You almost need a hacksaw to get into it. I just about managed with a pen knife. And you have to be careful – this stuff is sharp. There’s more plastic in the packaging than the product in this case. Not exactly environmentally friendly. A cardboard box would be perfectly adequate.