Sign in to follow this  
Followers 0
DBowers

Newbie question: How do you autogenerate an AutoIt script?

3 posts in this topic

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!

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0