May 19, 2006

Macro Scheduler Success Story – eDocFile, Inc.

Filed under: Success Stories — Marcus Tettmar @ 7:05 am

By Keith Passaur.

eDocFileThree years ago I started eDocFile, a company that specializes in image enabling applications. Before then I was a salesman working for a document imaging company and the products I sold were too complex and expensive for most users. During my training I learned about how years ago people wrote programs that pulled information from a user’s screen (screen scraping) and passed it onto other applications. I realized that if I could find an easy way to do this I could pull a unique piece of information from a users screen and use it to relate an image to the screen. This would allow the user to have an image enabled application.

Image Enabling an application is allowing images of documents to be retrieved from an application that contains data that relates to the documents. For instance, a user is in their accounting software application, they click on an icon or press hot keys and an image of the document appears on their screen that relates to the record in their accounting application. This is accomplished by screen scraping the application (capturing the data on the screen) and passing it on to a method of retrieving the document related to the screen data.

With Macro Scheduler I have been able to capture the screen and do all this. I cannot think of another product that would allow me to do this as easily. One product I developed for this determines what application the user is in, what screen they are on and what information needs to be gathered to scan an image or retrieve an image. Another program I developed works specifically with Loan Origination Software. It is called Scrape LOS.

After spending years testing other products, the National Association of Mortgage Brokers Strategic Alliance Committee approved Scrape LOS. The reasons were because of ease of use and price. Without Macro Scheduler this product could not have been developed and sold in the price range they were looking for. One client spent over eight thousand dollars on an application to scan and file loan documents. They dropped that product within six months and went with Scrape LOS. In a nutshell it is the old 80/20 rule. This application has eighty percent of the features at twenty percent of the price and twenty percent of the complexity.

Other products have also been developed with Macro Scheduler. The latest being one that productively routes faxes to email accounts, printers and folders based upon a set of rules. In its first week of release three copies of it were sold. I cannot say enough good things about Macro Scheduler as I am not a programmer, yet I can write these scripts that get the job done, quickly and economically.

Keith Passaur
President eDocFile, Inc.
www.edocfile.com

If you have a Macro Scheduler Success Story I’d love to hear from you. Drop me a line.

May 17, 2006

Use the Debugger!

Filed under: Scripting — Marcus Tettmar @ 8:55 am

[Update 23 Feb 2011: Click here for a video tutorial of the debugger in Macro Scheduler 12]

The first thing I turn to when helping someone get their script working is the debugger. But I’m often surprised to hear people say they didn’t know about the debugger. The debugger is an invaluable tool to help you find problems in scripts and is dead easy to use.

Macro Scheduler Script Debugger

Here’s how to use it. Open your script in the script editor. You’ll want to enable the watch list. This shows you the value of script variables and updates them as they change. Select “Show Watch List” from the “Debug” menu. This displays the watch list on the right of the editor, as can be seen in the picture above.

Step Through Line by Line. Place the cursor on the first line of the script and hit F8. F8 executes the current line and then stops and waits for you to press F8 again. This allows you to “step” through the script one line at a time. You’ll see the green arrow next to the current line and a border around it. You can now follow the flow of execution through the script at your own pace. Every time a variable is created you’ll see it appear in the watch list and when a variable value changes you’ll see the new value there.

Breakpoints. Note that F8 executes the current line so in most cases when you start debugging you’ll want to put the cursor on the first line. Sometimes you may just want to debug a part of the script so you can start at that point. That’s fine as long as the code before that point doesn’t set things up that are required to make the bit you want to debug work, such as initialising variables. If that is the case you can set a “breakpoint” just before the bit you want to step through and then run from the top. To set a breakpoint, put the cursor on the line where you want the breakpoint to be and select Debug/Insert Breakpoint. Now place the cursor on the first line and select Debug/Run. The macro will now run as normal but stop when it reaches the breakpoint and wait for you to step onwards using F8.

The Watch List is a very important tool in tracking down why values aren’t what you think they should be or why certain outcomes that depend on variable values take place. With the watch list you can see when a value changes and what line caused it to change. This is extremely helpful and can highlight scripting errors and bad logic.

Side Effects of Debugging. One thing to bear in mind is that the act of debugging slows execution down, since the script waits for you to execute each line. If a script is failing because it is running too fast and doesn’t have sufficient code to ensure the system is ready for each step (e.g. a lack of WaitWindowOpen commands) then you will probably find that when you debug the script it works! So here’s a tip: if the script works when you debug it but doesn’t when you run it, the problem is almost certainly a timing issue and you need more intelligent delays.

So if you have a script which does something unexpected at a certain point and isn’t working how you want it to, or throws up a weird error and you’re not sure which part of the script is the problem then use the debugger. You’ll then find out which bit of the script is the problem and can step through it to find out what the cause is.

[Update: In version 9.0 the debugger is part of the Advanced Editor. From Macro Properties click the “Advanced Editor” button.]

May 16, 2006

Switch off to Save the Planet

Filed under: Automation, General — Marcus Tettmar @ 8:31 am

Recent research from Computacenter and Fujitsu Siemens finds that the 200 largest UK companies waste £61m a year on unneeded electricity by using power-hungry, inefficient PCs. This wasted electricity equates to over 2.8 million kWh of energy.

Of course the recommendations from Computacenter and Fujitsu Siemens are that these businesses should throw out their desktops and replace them with “Green-PCs” made and supplied by, say, Computacenter or Fujitsu Siemens. Though, I’m not so sure that throwing out thousands of perfectly good desktop computers is that great for the environment either!

In fact the report also finds that “more than a third (37%) of workers don’t switch off PCs when they leave the office” and “by adopting green IT equipment and switching off desktops when not in use the top 200 companies will make annual savings of around £305,000 each”. One of the largest UK corporations could save up to £2m by adopting such policies.

So for those in a rush to get out the door at 5pm, or who forget to switch off their machine, why not create a simple Macro Scheduler macro which shuts down the PC automatically at, say, 6pm:

ShutDownWindows>0

Just in case you might be working late you could add a 30 second warning allowing you to cancel:

Let>ASK_TIMEOUT=30000
Let>Prompt=Shutting Down in 30 Seconds. No to Abort, Yes to Shutdown now.
Ask>Prompt,cont
If>cont=YES
  ShutDownWindows>0
Endif

May 11, 2006

Vista Application Compatibility

Filed under: Vista — Marcus Tettmar @ 12:29 pm

As you know we have been working hard on ensuring Macro Scheduler is compatible with Vista and our latest 8.0.2 maintenance release is built with support for Vista. But what about other applications?

Well, Microsoft’s “Application Experience Team” have started their own blog to provide resources for testing application compatibility and “To help make the Application Compatibility process manageable and successful for you, and help us learn about your experiences”. Their first post links to Microsoft Connect where you can sign up for the Application Compatibility Toolkit V5.0 Beta program to receive tools to test your existing applications for Vista compatibility.

Check out All Things AppCompat.

May 10, 2006

Macro Scheduler 8.0.2 Update

Filed under: Announcements — Marcus Tettmar @ 8:40 am

We have released Macro Scheduler 8.0.2 Maintenance Release. For more information see:

http://www.mjtnet.com/usergroup/viewtopic.php?t=2879

As well as some small bug fixes this release has been prepared for Vista and has been tested under Vista beta 2. Please note however that we do not yet officially support Vista as it is still a beta product. Also note that AutoLogon is not supported in Vista at this time.

May 9, 2006

Instant Directory Assistance

Filed under: General — Marcus Tettmar @ 8:12 pm

Here’s a novel use for Macro Scheduler. TeleQuery have released an inexpensive new tool, powered by Macro Scheduler and msNet, which does instant directory look-ups in the USA, and it doesn’t matter where you are in the world. This tool uses the most up to date and reliable telephone company databases to return the actual Directory Assistance listings for only $0.50. It lets you find telephone numbers based on full or partial name and address searches and will even do reverse look-ups – give it a telephone number and it will return the address.

TeleQuery Directory Assistance

Not only is this tool a time and money saver for anyone who needs to perform Directory Assistance queries but it also demonstrates the power and flexibility of Macro Scheduler and msNet for GUI and network tasks.

For more information Click Here or contact:

TeleQuery.Net, Inc.

Phone: 214-946-5116 – 8am-10pm Mon-Sun (Central Daylight Time)
Toll-free: 1-877-225-7827 – 8am-10pm Mon-Sun

Email: [email protected]
Web: http://www.telequery.net/

WebRecorder 1.72 Update

Filed under: Announcements — Marcus Tettmar @ 7:55 am

We have today made available WebRecorder 1.72 which adds the ability to hide and/or show Internet Explorer windows. IEAuto.DLL now includes the ShowIE function which lets you set the IE window to visible or invisible. This now means you can create WebRecorder scripts that automate IE transparently “behind the scenes” with invisible IE windows.

http://www.mjtnet.com/webrecorder.htm

May 2, 2006

Changing CMD’s Window Title

Filed under: Automation, Scripting — Marcus Tettmar @ 3:28 pm

When running command line tools, applications or batch files it is often necessary to watch the resultant command window. E.g. to detect their completion you can have the script wait until the command window has closed. The trouble with this is that when you run batch files the title of the command window is always just “C:\WINDOWS\system32\cmd.exe”. So if your script starts more than one batch file, or you have other CMD windows open, how do you know which CMD window is which?

Well how about predefining the window title of the new CMD window? We can do this with the Windows start command. The start command starts a new CMD window and lets you give it any title you want and run a program/command at the same time. For more info type start /? at the command prompt. So we can use this in Macro Scheduler with the Run Program command:

Run Program>cmd /c start "Window Title" "c:\bla\something.bat"

This enables us to monitor this specific window to see when the batch file completes:

Run Program>cmd /c start "My Window One" "c:\stuff\reports.bat"
WaitWindowOpen>My Window One*
WaitWindowClosed>My Window Two*
MessageModal>Finished!

Now you might be wondering why we’d want to do the above when you can just make the script wait for the program or command run to finish by setting RP_WAIT to 1, like this:

Let>RP_WAIT=1
Run Program>c:\stuff\reports.bat

Well, you may need to manipulate the window at some point during the process. Or you might want the script to detect if the batch file is taking too long to complete, like this:

Run>cmd /c start "My Window" "d:\test.bat"
WaitWindowOpen>My Window*
Let>WW_TIMEOUT=120
WaitWindowClosed>My Window*
If>WW_RESULT=FALSE
  //Timed out, email Administrator
  SMTPSendMail>[email protected],..........
Endif

Using the start command like this to set the CMD window’s title makes it much easier to distinguish between other command windows and ensure we manipulate the one belonging to our batch file.

April 28, 2006

Tight Loops

Filed under: Scripting — Marcus Tettmar @ 8:15 am

Tight loops consume CPU cycles. A tight loop that doesn’t yield to the processor will hog the processor and can prevent other processes getting the CPU and can therefore slow down your system. Consider this simple loop:

Let>x=1
Label>start
  Let>x=x+1
Goto>start

Run that and you’ll notice CPU utilisation for Macro Scheduler will jump up to around 99%. Now force the loop to yield to the processor with a tiny Wait statement:

Let>x=1
Label>start
  Let>x=x+1
  Wait>0.05
Goto>start

The difference is dramatic. CPU utilisation in Task Manager will now be next to zero.

The Wait statement delays the current process (the script) and allows other processes to get resource. It is basically allowing the processor to time slice. Without it the processor never gets a chance to do anything else.

So, always add a small Wait statement into a tight loop. If your loop doesn’t already perform any kind of Wait then add Wait>0.05 and it will improve performance immensely.

And I should listen more to my own advice! I’ve just noticed that the Calculator sample script doesn’t have a Wait in the main ActionLoop and chews up resources. Following my own advice I’ve added a Wait>0.05 and CPU utilisation drops to near zero. I’ll make sure this sample script is fixed in the next Macro Scheduler maintenance release and add some notes to the documentation under the Goto/Label and Repeat/Until topics.