Dec 3
So, I was learning a scripting language awhile back to help automate and secure some things with our public computers. The scripting language is for use with an application called "AutoIT", which is, well, both a compiler and run-time for the scripts themselves.

I needed to detect if an application window was present on the screen, and if it was, take appropriate action. So, looking at the following code documentation:
WinExists
--------------------------------------------------------------------------------
Checks to see if a specified window exists.
WinExists ( "title" [, "text"] )

I wanted to make sure that things were working as they should, so my test for this was as follows:


The problem, which I was unaware of, is that I apparently can't make the test (value) comparison in the manner that I did. The proper way to use this method was as follows:


What a bummer.

Posted by Brendon Kozlowski

0 Trackbacks

  1. No Trackbacks

2 Comments

Display comments as(Linear | Threaded)
  1. Mike says:

    I used to use autoit a bit to automate things in millennium...fortunately, I don't need to do that anymore since all of the processes requiring automation were replaced with others. That being said, I think autoit is a great tool. I'm not really sure what your complaint is though...are you saying you can't accomplish what you wanted to or just that you got the syntax wrong initially?

  2. Brendon Kozlowski says:

    I just got the syntax wrong initially. Although, after I looked more closely at my code, I think I had my logic backwards. Amazing that I didn't notice it after 5 weeks or so. It wasn't hugely important code, thankfully, so I was only looking at it for 5-10 minute intervals during my lunch breaks when I was bored.

    This particular snippet is from some small, separate executables that we'll be using to "fix" some "holes" in our PC reservation software (and automate another), and to bypass the security level set on all of the machines in order to run said things. It'll be used in combination with psexec over the network.

    It wasn't a complaint over AutoIt, more of a complaint that I wasn't either paying attention enough to my own syntax, or I didn't pay enough attention to the accepted and documented syntax of the language itself.

    My first script with AutoIt was used to hide desktop icons on the desktop upon logoff, and unhide them on logon. Our patrons were constantly clicking on icons before the PC reservation software (not necessarily Envisionware's PCRes) was completely started, which severely slowed down boot-up speed; and they only did it because they could see them and didn't really know better. After poking through some Microsoft documentation and messing with some low level hooks, I got it down to about 4-5 lines of code, but it was one heck of a learning experience!

Add Comment


Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

BBCode format allowed