Be careful when using an unfamiliar coding language
Wednesday, December 3. 2008
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:
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.
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.
Trackbacks
Trackback specific URI for this entry
No Trackbacks

Comments
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!