Jump to content

With...EndWith


Recommended Posts

I am trying to build a script to do the following:

     Open a program

     Input values that only has one changing variable

That's it. Since this is my first script with Autolt3 I am wanting to make sure what I am trying to do will work. I am using AutoItSetOption("SendKeyDelay",2000) to input a value.

The part I am trying to automate is one of the inputs is a file name and I need to do this to every file of the same extension and the following input needs to be the same name with the extension changed. Below are example inputs for what I am trying to automate.

 

0.05

2

example.iss

example.ssp

4

1

I want to run this program to input all of my .iss files (which I can put into a .txt list file if needed) and then change the extension to .ssp for the following input. 

I tested out the script and it runs perfectly for manually inputting the names for that input so it is just a loop function for this and I am unsure of how to set this up. 

Thanks!

 

 

Link to comment
Share on other sites

You could use _FileListToArrayRec to capture all the files with the .iss extension, then when you paste just loop the array, using For $i = 1 To $aFileList[0] then use StringReplace($aFileList[$i], ".iss", ".ssp") and then send that to the program.  Its also better if you use ControlSend not Send.

Link to comment
Share on other sites

How does that relate to the post title?

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

1 hour ago, Subz said:

You could use _FileListToArrayRec to capture all the files with the .iss extension, then when you paste just loop the array, using For $i = 1 To $aFileList[0] then use StringReplace($aFileList[$i], ".iss", ".ssp") and then send that to the program.  Its also better if you use ControlSend not Send.

Thank you for the suggestion I am trying this out now to see if it works!

I looked into the ControlSend and there are some issues with it and cmd programs according to the help menu.

Link to comment
Share on other sites

  • Developers

@wbrokaw,

In stead of reporting the question you could have opted to answer is as it seems to be a pretty valid question...no?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@Jos,

As I do not see a way of editing the title of the post and to avoid reposting it seems rather rhetorical...no? I noticed I didn't update the title before hitting submit after it was submitted. 

So no, it does not seem like a pretty valid question when it is obviously wrong. In my original post I was going to make I thought that function might be what I needed but then after scouring the help I realized it wasn't and just forgot to update the title and someone else had already posted something that was useful for what I was doing so reposting didn't seem like it was worth it. 

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...