You may also want to note that AutoIt also provides a whole suite of on screen user interface options… so pretty much anything ScreenAce could do, AutoIt can do. Grids, radio buttons, etc.
Additionally you don’t have to compile the script… I used a br program to write an autoit script and then called it like “sy autoit.exe thescrit.au3” … that was what I did with my move my br screen function… br passed the parameters of where to relocate the br screen to, and autoit did the work.
p.s. if we ever get a webinar together than I’d enjoy spending some time sharing autoit, tips, tricks, do’s and don’t’s with the others of you who use it from time to time, or those of you who are just interested in learning more about it.
[mailto:firstname.lastname@example.org] On Behalf Of
Wednesday, May 13, 2009 1:12 PM
Business Rules Forum
Re: [BR_forum] AutoIt
Excellent examples! Thanks!
Gabriel Bakker wrote:
I use it to autogenerate PDFs from within my application under 4.1 and earlier without having to worrying about other limitations.
I just print the report using NWP (and place my logo on it and pictures and shading and grids and proportional fonts and colors.) I print it to CutePDF which is a program that runs as a printer driver and lets you print anything to a PDF that you want. The only problem is CutePDF opens a dialog asking the user where they want to save the PDF file. My 3 line auto-it script waits for CutePDF's dialog to open, and then clicks on the text box where you type the file name, then types in the name I want to save it to, and clicks the ok button. I was able to compile my AutoIT script into a single executable called "SavePDF.exe". My SavePDF.exe even takes the path and file name as a parameter.
In BR, I print the print job, close #255:, execute SavePDF.exe giving it the filename, and then wait for the resulting file to appear in the proper location.
What amazed me is how reliably it worked, and how easy it was to create the script. I didn't use the auto-it manual - I just looked auto-it up on google and found tonnes of resources that explained to me exactly how to do what I wanted. I thought it would be unreliable to have a script that sends mouse clicks and keyboard commands, but AutoIT has been the most reliable part of the whole system. Its never once failed.
I had serious doubts about AutoIT when I started, but by the time I finished writing my first script (20 minutes later) I was hooked. The ability to compile it to a stand-alone executable (with a nice pretty icon) added a professional touch that I wasn't expecting, and that I thoroughly enjoy.
Foxtree has clients addresses stored in one of their data files. Using AutoIT, I can make them a simple BR routine where they select a client from a listview and click the "Google Earth" button. BR launches Google Earth, and then runs a simple AutoIT script, which clicks on the Google Earth Search Box and types in the clients address and then clicks the "Go" button. To the end user, they hit the "Google Earth" button and a window pops up with a view of the earth which slowly rotates and zooms in right into a satellite view of their customers house.
Because you can use AutoIT to send Keyboard Presses and Mouse Clicks to any other program, you can write an AutoIT Script to do anything
to any other program you want
no matter what Integration options that program has. You can open Microsoft Word and "type" an entire document in. You can open a Picture Viewer and control a slide show. You can launch Internet Explorer (or your browser of choice) and navigate to your banks web sight, then click in the "User" and "Password" fields and type your login information in, and then click on the various menu options to automatically download banking history in a CSV file that BR then imports and reads through. (That might not be recommended, however).
Heck, I could even use AutoIT to write a BR program that orders me a pizza from PapaJohns.Com, and pays for it by giving my papajohns account information (or by just typing my credit card information directly in for me (although again, not recommended)).
With AutoIT and creativity, there is no limit to what I can make BR programs do.
One important note, however: I still consider AutoIT to be an inferior solution to any form of direct integration. I still try to find any way to integrate BR directly with the application in question that I can, and I only use an AutoIT script as a last resort.
But having AutoIT in my toolbox has just opened up a whole vista of whats possible to do from a BR program.
On Wed, May 13, 2009 at 11:27 AM, Susan Smith <email@example.com (firstname.lastname@example.org
Sometime when you have a moment (I know you're working at a client site this week, so not now), I'd love to know what sorts of things you can do with Autoit to integrate things with your BR programs. I have AutoIt and have read the (confusing) documentation, but my biggest hurdle is visualizing the usefulness of it with BR. (sort of like new BR features listed in the release notes when I don't know WHY those features were added and what they were designed to do). If I had some examples of how people were using it, I might be able to jump on the bandwagon a lot sooner.
Gabriel Bakker wrote:
I waited years to try AutoIt. Now that I finally have, I realise I can use it to integrate my BR programs with literally anything
. It is powerful in a way I never dreamed.
On Sun, May 10, 2009 at 9:15 PM, Susan Smith <email@example.com (firstname.lastname@example.org
I really need to find the time to explore this program further!
John Bowman wrote:
autoit is made to drive other windows around and interact with them, and it compiles into standalone .exe's or you can run the script like a batch file that you can generate the script in br and then sy 'autoitexe my_dynamic_script.au3'. it has the ability to create text files and stuff so that you can feed the info back to br that way too.