June 17, 2006

Spelling Complaints

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

I just received a reply to my “Macro Scheduler Resume” mailing that I sent out a few weeks ago. The sender was complaining about an incorrect spelling and suggested that my email would be seen as unprofessional if forwarded to other businesses. His complaint was that I used the spelling “Organisation”.

The fact is I am British. I live in England and was educated here. MJT Net Ltd is a British company, registered in England and Wales. Organisation is the correct British spelling. I make no apologies for being British and I can’t help automatically using British spelling when I write.

Definition and Spelling:
http://dictionary.reference.com/browse/organisation

Should I have used the spelling “Organization” in an email sent to my customers? Well, in our software and documentation we do TRY to use American English spellings as much as possible, just because we know that around 50% of our customers are in the USA. But from time to time we might miss one or two. After all we can’t help using British spelling and may not even realise (realize) there is a different American variant sometimes. Also a large number of our customers are European, consisting of many British. So what should we do? Write different versions of the software and documentation for different people? That would be quite inefficient and is simply not practical (although, with the help of others, we are slowly getting our software and documentation translated into other languages).

Anyway, when I write emails I prefer to write in a personal style. My emails are from ME, not a marketing person or a robot. I actually think that in this day and age this is quite important. So I will write using my own style. That means I will use British spellings.

The email I sent was designed to be forwarded on to others. It was a light-hearted way at, hopefully, encouraging a bit of word-of-mouth and introducing customers to our affiliate schemes, whereby they can benefit from recommending our software to others. But there was certainly no obligation to do so. And of course there is also nothing to stop anyone modifying, localising (localizing) or even translating it for their chosen recipients.

So, I make no apologies for being British and for writing the way I was taught to write.

June 12, 2006

Automated Google Rank Checker

Filed under: Automation, Scripting, Web/Tech — Marcus Tettmar @ 10:43 am

I’ve just had a bit of fun writing a couple of small scripts that will search Google for a set of key phrases and find the position of a specified URL for those key phrases in the results. I have built two versions of this script. One with a simple dialog where you can enter a URL and key phrase to search for, and another which takes a set of key phrases in an input file and produces a CSV file with the results and date. This second script can be scheduled to take place every night. The CSV file will grow with the new results and can be opened in Excel and a chart produced showing the trend over time of your website position for those key phrases.

As well as being extremely useful as an automated way to monitor the performance of your keywords in Google, these scripts also demonstrate what can be done with some simple Macro Scheduler scripting and WebRecorder. The scripts are not long and give a glimpse at the sort of things WebRecorder and Macro Scheduler can do to automate web sites and parse the resultant HTML.

Download the scripts here:
http://www.mjtnet.com/usergroup/viewtopic.php?t=2983

Note that these scripts automate IE and therefore operate at the user level just as if you were using Google yourself.

June 9, 2006

Vista too Chatty?

Filed under: Vista — Marcus Tettmar @ 1:10 pm

If you’ve been playing with the Vista betas recently you’ll have noticed how often it asks for your permission to perform admin level functions. By default Vista runs all users as ordinary level users (even if you’re logged in as an Admin) and asks for permission via “Elevation Prompts” every time an admin function is required. All fine and dandy – and much more secure – in theory, but many people have commented on how “chatty” this makes Vista. Early betas were worse and just copying a file can be really quite annoying.

Well, Steve Hiskey of the Windows Security Core Group over at Microsoft has written about how they intend to reduce elevation prompts and how they are working hard, both internally and with external ISVs, to make Vista a little less “noisy”. Well worth a read if you’re concerned about all those pesky elevation prompts, or if you’re writing applications for Vista and want to help improve things.

The UAC team have quite a challenging role – to make using Vista more secure without making it more cumbersome and more difficult to use than XP. They still have a few challenges ahead of them, but I can vouch for their commitment and support for independent software vendors as Steve and his team were extremely supportive in helping us ensure Macro Scheduler could record properly in Vista. So if you’re beta testing Windows Vista be sure to help them out via their blog.

Reducing Elevation Prompts in RC1

June 8, 2006

Vista Beta 2 Launched to the Public

Filed under: Vista — Marcus Tettmar @ 6:51 am

The Windows Vista Customer Preview Program was launched yesterday evening making Vista beta 2 available to everyone. Until now it has been confined to members of the Technical Beta Program and MSDN subscribers. Now anyone can download it or order a copy on DVD. So if you are wanting to try Vista out now is your chance.

http://www.microsoft.com/windowsvista/getready/preview.mspx

June 6, 2006

Screen OCR – Recognising Graphical Text

Filed under: Automation, Scripting — Marcus Tettmar @ 10:26 am

[UPDATE: 27.3.2018 – Since this article was written Macro Scheduler now has built in Screen OCR functions]

We often need to write scripts that extract text from a window or some area of the screen. Usually this can be achieved via the clipboard, or commands such as GetWindowText and GetControlText, or via a Win32 API function. However, this only works with text that really is text, and with objects that expose text as a property of itself. For example, many Windows controls have a caption property which exposes the text associated with it. In this instance we can write code to capture the text by accessing that caption property.

But don’t forget that anything you see on the screen is really graphics. Text is rendered using fonts and fonts are just made up of a combination of coloured pixels. Not all text that you see on the screen is accessible via a simple object property. Sometimes the text you see is just pure graphics. Yes, it reads like text to us humans – we can make sense of it. But to the computer it is a sequence of dots. An arrangement of pixels. So how can we write a script to ‘read’ that text?

Well in these cases where the text is not exposed as a textual object, and is only represented graphically, the only way forward is to use Optical Character Recognition (OCR). There are many OCR packages available on the market which will read an image file, scan it for recognised characters and output ASCII text. So one approach would be to automate one of these OCR applications with Macro Scheduler. Macro Scheduler could first take a screen shot (using the ScreenCapture function) and then automate an OCR application, having it read the screenshot and output the text to a file.

But a less cumbersome approach is to use an excellent tool called Textract from Structurise. Textract is a library that will scan a window, screen area or image file, and output recognised text. Textract comes with a command line interface that makes it ideal for use within a Macro Scheduler script. Here is a small example script which scans the foreground window and retrieves all the text within it:

//Path to Textract
Let>TxPath=c:\\\textract

//Focus the App if necessary
//SetFocus>Notepad*

//Get bounds of active window
GetActiveWindow>title,x1,y1,w,h
Let>x2=x1+w
Let>y2=y1+h

//Set Run to run hidden and to wait for completion
Let>RP_WAIT=1
Let>RP_WINDOWMODE=0

//First time you run this on a new system uncomment next line
Run>%TxPath%\\\textra.exe /build

//Run Textra to retrieve all text in window.  Make sure we run hidden!
Run>%TxPath%\\\textra.exe /capture %x1% %y1% %x2% %y2% /ascii %TxPath%\\\tmpOutput.txt

//Read from output file into script variable and delete file
ReadFile>%TxPath%\\\tmpOutput.txt,TheText
DeleteFile>%TxPath%\\\tmpOutput.txt

//Just as an example display the text
MessageModal>TheText

This script simply displays all the text found in the entire window in a message box. You would probably want to parse the text in some way. Or you may just want text from a specific part of the window. You can do that by making the screen coordinates more specific and making the rectangle smaller. This is a really slick way of identifying text that isn’t otherwise visible as text to Macro Scheduler or Windows.

To get a list of options type textra.exe on the command line and see the documentation that comes with Textract.

You can download Textract from:
http://www.structurise.com/textract/

June 1, 2006

Rant: Windows Apps Should LOOK Like Windows Apps!

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

The other day a friend of mine phoned me. He was trying to install the software that came with his new Nokia mobile phone. He said he was beginning to go mad. He just couldn’t see what he was missing. He said that when he started the installer a screen came up with a license agreement which he had to confirm. But the “Next” button was grayed out. He couldn’t continue. He couldn’t see what he had to do to continue. He was at the end of his tether, so he phoned me.

I set up a BeamYourScreen session and connected up to his PC and started the installer. I could see what he meant. The installer was kind of metallic. All the controls and objects looked completely unlike anything I had ever seen before. No idea why, because I wouldn’t even say it looked “cool”. When we got to the license screen the continue button was disabled. I noticed a tiny (really tiny) little round thing to the right of the license text, on a kind of dashed vertical line. I clicked on it and was able to drag it down. Yep, sure enough it was a scroll bar and when we got to the bottom the continue button became enabled.

Now, it took me only a few moments, but it was not immediately obvious. Gerry was kicking himself and felt a bit embarrassed but I don’t think he should have felt that way. None of the objects on the screen looked like familiar Windows objects. The scroll bar was obscure and completely unlike a regular scroll bar. There’s no reason why Gerry should have known immediately what he was supposed to do. He uses Windows and was installing software for Windows. He knows how Windows works and what Windows scroll bars look like. He shouldn’t be expected to have to use an unknown, alien, design.

If you are developing software for Windows then it should LOOK like Windows. There’s a reason why Windows uses standard controls and a standard look and feel. Sure, colours and fonts can be changed, but that’s up to the user. A Windows app should adjust automatically to follow the user’s selected layout. An application should not make up a whole new look and feel. Whatever you may think of the Windows user interface, no matter how much a designer may dislike the way Windows looks … well that’s tough! You’re designing for Windows, so that is how it has to be. And surely you want your customers to know how to use your software! Surely that’s what is important. Therefore your software should look familiar. It should use standard Windows objects and follow standard Windows conventions. My mate was close to going back to the shop and changing his Nokia for another phone because he couldn’t install the software that let him connect his laptop to the ‘net like he wanted.

Fine, supply skins that let your users change the look and feel of your application, but do this AFTER it has installed. What is the point of an installer that looks alien and doesn’t follow the Windows look and feel? Users shouldn’t have to learn a whole new user interface design just to install your software. Frankly, Nokia should know better. The interfaces their phones use are widely regarded as the most user friendly. But when they write software for PCs they shouldn’t reinvent the Windows interface!

May 31, 2006

Microsoft Shames Pirates

Filed under: General — Marcus Tettmar @ 9:05 am

A page on Microsoft’s website currently lists almost 100 cases they are taking against software pirates that have been discovered through Windows Genuine Advantage. You can click on each case and see more details of their alleged crimes.

This could be rather embarassing for companies that are distributing illegal copies of Microsoft Software and the details could be found by potential shoppers when searching the web for information on these firms. If you’re looking to buy Microsoft Software check this out first and avoid these people. It will be interesting to see how effective this public shaming approach turns out to be.

Partner Piracy Alerts

May 25, 2006

Vista Beta 2 Released

Filed under: Vista — Marcus Tettmar @ 5:44 am

So Vista Beta 2 was made available to MSDN subscribers this week. We installed a copy yesterday and my first impressions are good. It installed quickly with the minimum of fuss and the performance is good – it seems pretty quick. Beta 1 was agonisingly slow so it’s good to note that beta 2 is faster. No doubt beta 1 had lots of debug/diagnostic code in it which was slowing things up, and they’ve probably worked on improving performance generally since beta 1. Macro Scheduler 8.0.3 runs nicely in beta 2, as I expected 🙂

Now that beta 2 is here things should start to settle down, documentation will hopefully improve, and more developers will start working on Vista-izing their software. So things should become clearer and we can hopefully get a better idea on what it will take to create a Vista version of AutoLogon. Watch this space.

May 22, 2006

Be Helpful!

Filed under: General — Marcus Tettmar @ 11:36 am

As a Macro Scheduler envangelist, I keep an eye on several usenet newsgroups for any reference to windows automation software, or anyone asking for help with automating some task. I also subscribe to Google Alerts so I know when a new article has been posted which contains certain key phrases. Now, of course, with my PR hat on, one thing I hope for is an opportunity to answer the question by demonstrating how Macro Scheduler can help solve the problem. However, the wrong thing to do is just post a link to Macro Scheduler in response to any question vaguely related to macros in Windows. This is just the sort of thing that upsets people, especially in the Usenet community.

However, this is exactly what I’ve seen other people do. I’ve seen a number of messages from software companies which are nothing more than boilerplate sales notes used in response to someone with a specific need. At the very least, if you think your software will solve the problem, then post an example showing how! Often though, you don’t even need any third party software to solve the poster’s problem.

For instance, I saw a message recently where someone wanted to schedule a call to a web page. All he needed to do was have his browser go to a specific URL once a day. That’s it. The URL did some processing on his web application, so it just needed running once a day. No interaction required – just call up the URL and then close the browser. He had created a Windows Task Scheduler entry which ran Internet Explorer with the URL on the command line. But the drawback was that it leaves a copy of IE running, and when he was using the PC the IE window would get in his way.

A developer of a basic macro tool had posted a response which said nothing more than “you can use our software to do this” – with a link to their website. No indication of how. But, you don’t need any third party software to automate that! You can use VBScript, built into Windows, and IE’s ActiveX interface to do the whole thing transparently. So I wrote a few lines of VBScript code and explained how to schedule it. No need to pay for any other tools.

What did I get out of that? Well, apart from the satisfaction of trumping a wannebe competitor, I helped someone with a useful response. That feels good. Of course I also mentioned Macro Scheduler and a link to mjtnet.com in my signature. Maybe, one day, the poster, or someone who reads that thread, will remember that and check out Macro Scheduler. Maybe their requirements will one day be greater and they will need to do other things that can’t be done with built-in tools alone. Hopefully they’ll remember me, because I gave a helpful response, and they’ll come and check Macro Scheduler out.