Jump to content

How to loop through a files list for same processing steps


DrGert
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

@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 ;)

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...