FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!

Windows automation




AutoIt is a wonderful tool to automate tasks on your Windows computer. With a bit of programming skill you can accomplish a lot to make your life easier.

Here is just one example how a few lines of code save me a lot of time: I have a scanner software for my CanoScan 5600F which I currently use to scan in slides. The unit allows to scan in 4 slides with one shot. The scanner software ( MP Navigator EX ) however first scans a preview of the four slides and then puts up a dialog where it asks me which slides I actually want to scan in. There is a "all" checkbox but by default it is turned off and only the first slide is selected to be scanned in.
I ALWAYS want to scan in all of the slides, thus I ALWAYS have to click that annoying checkbox to proceed with my scanning. As you can imagine the entire scan process takes a couple of minutes and thus I would just love all of it to happen after I started it without any further user interaction. Nope, no way with the software itself, no option to set "all" slides to be the default.
Here are the 8 lines of AutoIt script code which in the future will click that stupid checkbox for me and proceed with the scanning:
Code:

$title = "ScanGear"
$text = "Zu scannendes Bild"
While 1
    WinWaitActive($title,$text,10)
   If WinActive($title,$text) Then
      Send("{TAB 2}{SPACE}!s")
   EndIF
Wend

How does it work ?
It basically runs forever and waits 10 seconds for a window with a particular title containing some particular text to appear. As soon as that window shows up it sends a few key strokes to that window ( here: two tab key strokes to advance to that checkbox, a spacebar to select it and Alt-s to start the scanning ).
Nice hack to make that scanner software work as I like it to work. Thus AutoIt is good for automating all sorts of tasks on your Windows computer, but it is also great in fixing annoying behavior of software tools.

Let me end my blog posting here by showing you one of my recently scanned-in slides:

These are slides shot during my visit to the East Coast of USA in 1997. More slides are here in my flickr set USA 1997.



0 blog comments below




FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.