DBowers Posted February 18, 2008 Share Posted February 18, 2008 Hi, I have just started to learn AutoIt scripts and I think it's an amazing tool. I have an AutoIt script that takes one input parameter (hard-coded now) and simulates keystrokes, mouseclicks etc to generate a report out of our ERP system. I will need to run this script for N times with the value of that input parameter coming from a database. Is there a way to programatically generate this AutoIt script based on my database input, and then make it an executable file? Thanks! Link to comment Share on other sites More sharing options...
Kerros Posted February 18, 2008 Share Posted February 18, 2008 Hi, I have just started to learn AutoIt scripts and I think it's an amazing tool. I have an AutoIt script that takes one input parameter (hard-coded now) and simulates keystrokes, mouseclicks etc to generate a report out of our ERP system. I will need to run this script for N times with the value of that input parameter coming from a database. Is there a way to programatically generate this AutoIt script based on my database input, and then make it an executable file? Thanks! Well I think think of two ways to do this off the top of my head, there may be better ways, but I can't think of them currently. 1.) Create a Wrapper program that goes out and reads the values from the database and then passes those values back to the original program. Better example, in my mind at least 2.) Read the database to an array at the beginning of the script and then use a for to next loop to walk through the values of the array passing them to a function, which would be your original script. IE: $databaseread = _filereadtoarray('C:\whatever.txt') ;just an example, you would need to find out how to access the database. for $icc = 1 to ubound($databaseread)-1 original_script($databaseread[$icc] next func original_script($value) whatever your original script was endfunc Kerros Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance. Link to comment Share on other sites More sharing options...
DBowers Posted February 18, 2008 Author Share Posted February 18, 2008 Kerros, Thank you so much! That helped a lot. Well I think think of two ways to do this off the top of my head, there may be better ways, but I can't think of them currently. 1.) Create a Wrapper program that goes out and reads the values from the database and then passes those values back to the original program. Better example, in my mind at least 2.) Read the database to an array at the beginning of the script and then use a for to next loop to walk through the values of the array passing them to a function, which would be your original script. IE: $databaseread = _filereadtoarray('C:\whatever.txt') ;just an example, you would need to find out how to access the database. for $icc = 1 to ubound($databaseread)-1 original_script($databaseread[$icc] next func original_script($value) whatever your original script was endfunc Kerros Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now