September 8, 2009

August 28, 2009

Kudos

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

Just received this email and had to share it.  It’s notes like this that make it all seem worth it, especially at the end of a long week. 🙂

To ALL

I’m sorry.  I know I must sound like a broken record.  But……

OMG!!!

You guys are AWESOME!!!

The LEVEL of Tech Support here is insane!! It is through the roof!  The Freak’n roof is on FIRE!!!

The POINTS are OUT the WINDOW!!

How DO you do it?  You have to answer so many e-mails and yet you maintain this unheard of level of
EXELLENCE!!  I KNOW you have to deal with some….well you know.  And yet…..

OMG!!!

Please tell me you can’t help me, just so I know I’m still ALIVE!!

Keep up the GREAT work!
PepsiHog

Determine IE Version and Automate IE Dialogs

Filed under: Automation, Scripting — Marcus Tettmar @ 2:25 pm

If you are automating web pages or web applications you may at some point need to automate dialog boxes produced by client side script, like the one that pops up when you click the link below:

Confirm Popup

So you might want to be aware that the title of these popups varies between different versions of Internet Explorer. In IE6 it was “Microsoft Internet Explorer”. In IE7 it is “Windows Internet Explorer” and in IE8 it is now “Message from webpage”.

I much prefer the last one from an automation point of view since it differs significantly from the title of the main IE window which usually contains the phrase “Microsoft Internet Explorer” in IE7 and “Windows Internet Explorer” in IE8.

So if we wanted to click on the Yes button if we were writing a script for IE8 we could use the following code:

SetFocus>Message from webpage
Press Enter

But what if we didn’t know what version of IE our script would be automating? If you were giving your script to someone else or putting it on some other PC you may not know what version of IE was being used. What we need to do is make the script find out what version of IE is installed on the computer.

Here’s how to make the script determine which version of IE is in use:

RegistryReadKey>HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Internet Explorer,Version,IEver
Separate>IEVER,.,bits
Let>IEVER=bits_1

IEVER now contains the major version number of Internet Explorer.

So we could now use this to define the title we expect from the dialog box and confirm it:

RegistryReadKey>HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Internet Explorer,Version,IEver
Separate>IEVER,.,bits
Let>IEVER=bits_1

Let>dialogTitle_IE6=Microsoft Internet Explorer
Let>dialogTitle_IE7=Windows Internet Explorer
Let>dialogTitle_IE8=Message from webpage

SetFocus>dialogTitle_IE%IEVER%
Press Enter

Of course this is all assuming you’re using the English version of Internet Explorer. I cannot vouch for other languages.

August 26, 2009

Strange Support Requests

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

I never ceased to be amazed at some of the queries we get. This one came in today via Live Chat. Perhaps it was a joke:

Strange Support Chat

Weird.  Now, I did wonder for a minute if the thesis had something to do with the use of Macro Scheduler or automation tools or similar, in which case I might have been able to help somehow, but after asking how the question related to Macro Scheduler the requestor simply said sorry and left.  So it clearly didn’t.

The only way to initiate a live chat request is via our website, which I’m pretty sure doesn’t say anything about offering translation services. Last time I looked (just now) mjtnet.com is pretty obviously all about Macro Scheduler and our other automation tools.

August 25, 2009

The Power of DOS: Looping Through Subfolders

Filed under: Automation, Scripting — Marcus Tettmar @ 7:37 pm

Twice today, for two different people, I needed to write some code to iterate through files in a tree of subfolders. The subfolder structure could not be known up front and there may be any number of subfolders and any number of folders deep.

One could use GetDirList iteratively, or use VBScript’s FileSystem Object. But then I was reminded of the power of DOS by JRL in this post.

The following returns a file containing a list of the jpg files throughout all folders, starting in c:\root_folder\ with full paths:

dir c:\root_folder\*.jpg /s /b > outputfile.txt

So, as JRL suggests, we can call that command from Macro Scheduler and then read in the output file. We should use a temporary file:

Let>RP_WINDOWMODE=2
Let>RP_WAIT=1
Run>cmd /c dir c:\root_folder\*.jpg /s /b > %TEMP_DIR%~temp_dir_list~
ReadFile>%TEMP_DIR%~temp_dir_list~,dir_list

Now we can explode that list into an array and loop through it, doing whatever it is we need to do to each file:

Separate>dir_list,CRLF,files
If>files_count>0
Let>f=0
Repeat>f
  Let>f=f+1
  Let>this_file=files_%f%
  //do something with this_file
Until>f=files_count

It’s easy to forget the power of DOS – it can save you a fair few lines of code sometimes.

Remember that any DOS command can be “piped” to an output file by appending >filename to the command line. This is very useful as we can then use ReadFile to get the output from the command, as we have done above.

August 17, 2009

Summer Sale – Prices Reduced – 20% off Upgrades

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

For summer only we’ve reduced the prices of our popular items. Macro Scheduler Pro (Single User) is now only $195 USD and Macro Scheduler Standard (Single User) is $95 USD. Incredible value!

See prices and purchase on-line here.

And with the following coupon code you can get 20% off all Macro Scheduler upgrades:

Coupon Code: UPGRADE11

(Enter the coupon code on the cart page and hit Checkout to view calculated discount)

August 11, 2009

Windows 7 Keyboard Shortcuts

Filed under: General, Windows 7 — Marcus Tettmar @ 4:37 pm

Back in January we were able to download the Windows 7 beta and I reported that Macro Scheduler 11 is fully compatible with Windows 7. Yesterday the final RTM (Release to Manufacturing) version was made available to MSDN subscribers and so today I upgraded my Vista desktop to Windows 7.

I am pleased to report that the upgrade went painlessly. The only issue I encountered after the upgrade was lack of audio which was easily rectified with a visit to Creative’s website and a download of the updated driver for my audio device. Needless to say, Macro Scheduler is running smoothly under this shiny new interface.

Most people seem to be saying that Windows 7 is the Vista upgrade that makes Vista what it should have been. Seems pretty slick so far, but I’ll report back after I’ve been using it a while.

In the mean time here’s a full list of keyboard shortcuts in Windows 7 which may come in handy for Macro Scheduler developers.

Find and Click on Screen Text with MODI

Filed under: Automation, Scripting — Marcus Tettmar @ 8:21 am

Gale Dyvig has just posted some code in the forums showing how to use the Microsoft Office Document Imaging OCR component to locate text on the screen, find its position and click on it. Very useful. You’ll find it here.

MODI is a component that comes with Microsoft Office. You need to ensure Microsoft Office Document Imaging and Office Shared Features / Proofing Tools is installed in Office Tools.

Thanks Gale!

August 5, 2009

Examples are Examples

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

Examples are examples not doctrine. In the topic on the “Release” command in the Macro Scheduler help file it mentions that to exit a program you might do:

Press ALT
Send>fx
Release ALT

This would hold down ALT while sending the f and x keys before releasing the ALT key again. Commonly this invokes the standardised File/Exit menu option.

But this is not always true. Not all apps have these options. Not all aps have a File menu. And as we’ve seen in my last post, not all apps work the way we would expect them to. The above is just an example. It’s not dictating the way all Windows apps work. Not every application is the same or obeys the “rules”.