Don’t Disable Vista Security Features
Great post by Jesper Johansson, Senior Security Strategist at Microsoft, on Vista security and why beta testers should not disable User Account Control just yet: http://tinyurl.com/j5z7x. Worth a read.
Macro Recording and Automating Windows with Macro Scheduler – Tips & News
Great post by Jesper Johansson, Senior Security Strategist at Microsoft, on Vista security and why beta testers should not disable User Account Control just yet: http://tinyurl.com/j5z7x. Worth a read.
If you’re wondering why I have been a bit quiet the last few days this is the reason. Benjamin Albert Tettmar was born yesterday, June 21st at 2020 GMT. Angela and baby are recuperating in hospital after a long and gruelling 48 hour labour! But both are doing just fine and will be home soon.
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.
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.
I have just uploaded version 1.03 of the Image Recognition Library. This fixes a bug with CompareBitmaps where the percentage match value returned could be incorrect. The CompareBitmaps function now works properly! Download the update from:
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.
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.
[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/
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!
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.