Jump to content
DrGert

How to loop through a files list for same processing steps

Recommended Posts

DrGert

Hello All,

Newbie Autoit user here.

I have a Windows 7 program to process photos that does not have a batch function but offer a very unique sharpening method that I like to apply to a list of approx 500 images.  I am envisioning a scenario where I provide the list of files to process either as a text list within a script or (more comfortable) have the script open a files selection dialog box and then process them one by one. I am not too familiar with the way Windows programs allow direct script access to their respective command functions so my idea is to just use a replay of mouse clicks into the image processing programs UI to perform the desired steps.

The sequence of tasks as I envision them is:

  1. Open my image processing program (I can even do that manually before launching the Autoit script)
  2. Via mouse clicks navigate to the open file dialog
  3. Inject a file path + name from a previously provided list
  4. Via mouse clicks perform multiple steps of actions in the program
  5. Via mouse clicks navigate to the file save as dialog
  6. Inject a path + name that has a relationship to the name under #3 (i.e. same name with additional suffix like name_processed.txt
  7. Via mouse click OK to save.
  8. Jump to #2 until list in #3 is all done
  9. Close program

Again, Autoit newbie here. Where can I find detailed instructions, examples, help to get the task done without bogged down under a long learning curve?

Thanks,
Gert

Share this post


Link to post
Share on other sites
gruntydatsun

what is the name of the image processing program you're using?  if it has command line switches that is a more reliable and much easier way than automating the user interface.

Share this post


Link to post
Share on other sites
DrGert

@gruntydatsun

Here is the program web page :

http://www.astronomie.be/registax/

I have not seen cmd line options there.

 

Is there a particular difficulty/complexity in the desired Autoit functionality that it is preferable to search for other target program options ?

 

Thanks,

Gert

 

 

Share this post


Link to post
Share on other sites
JLogan3o13

@DrGert welcome to the forum. See below:

  • Open my image processing program (I can even do that manually before launching the Autoit script)
    • Look at the Run function in the help file.
  • Via mouse clicks navigate to the open file dialog
  • Inject a file path + name from a previously provided list
    • Take a look at the example for FileOpenDialog, this function returns the path to the file you select.
  • Via mouse clicks perform multiple steps of actions in the program
    • Take a look at the AutoIt Window Info tool (in the same directory where you installed AutoIt). With the application open, hover over various features (buttons, menus, inputs, etc.) to see what the tool returns. Then look at the Control~ commands in the help file: ControlClick, ControlSend, etc. Pay attention to the examples for the Control commands to learn how to make use of the information you get from the AutoIt Window Info Tool.
  • Via mouse clicks navigate to the file save as dialog
    • Same as above
  • Inject a path + name that has a relationship to the name under #3 (i.e. same name with additional suffix like name_processed.txt
  • Via mouse click OK to save.
    • ControlClick
  • Jump to #2 until list in #3 is all done
    • Check out For Loops in the help file to see how you can loop through all of the files
  • Close program
    • ControlClick

     Each of these sections of the help file has at least one solid example to give you an idea how the function works. Try them out for yourself, making sure you read and understand why things do what they do (will help you pick up harder tasks much more easily as you progress). If you get stuck on any section, post your code here even if it does not work, and we will do our best to assist ;)

 

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.