Sign in to follow this  
Followers 0
TimW

Determining Next File

4 posts in this topic

Hi all,

I was led to AutoIt because I have a repetitive task that I need to do to multiple files. Using ScriptWriter, I was able to automate the task that I need to perform on one file. However, I cannot figure out how to tell the script to open the next file, repeat the process, then stop when there are no more files in the directory.

Basically, what I am trying to do is open up a file in Adobe Captivate, make some changes to the settings of the file, publish the file, save and close the file, and then open up the next file to repeat the process.

Here is script that was created using ScriptWriter to automate the task for one particular file:

#region ---Au3Recorder generated code Start ---
Opt("WinWaitDelay",100)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)

_WinWaitActivate("Adobe Captivate","")
Send("{CTRLDOWN}o{CTRLUP}")
_WinWaitActivate("Open","")
MouseClick("left",159,93,1)
MouseClick("left",517,369,1)
_WinWaitActivate("Adobe Captivate - Accessing Functions.cp","")
MouseClick("left",266,47,1)
MouseClick("left",281,98,1)
_WinWaitActivate("Rescale project","")
MouseClick("left",138,90,1)
Send("{SHIFTDOWN}{HOME}{SHIFTUP}965")
MouseClick("left",699,491,1)
_WinWaitActivate("Adobe Captivate - Accessing Functions.cp","")
MouseClick("left",122,134,1)
_WinWaitActivate("Adobe Captivate - Accessing Functions.cp*","")
Send("{SHIFTDOWN}{F12}{SHIFTUP}")
_WinWaitActivate("Publish","")
MouseClick("left",502,433,1)
_WinWaitActivate("Publish progress","")
MouseClick("left",356,136,1)
_WinWaitActivate("Adobe Captivate - Accessing Functions.cp*","")
MouseClick("left",1272,37,1)
_WinWaitActivate("Adobe Captivate - Accessing Functions.cp","")
MouseClick("left",255,102,1)

#region --- Internal functions Au3Recorder Start ---
Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc
#endregion --- Internal functions Au3Recorder End ---

#endregion --- Au3Recorder generated code End ---

Any thoughts on how I can create the script I need to create?

Thanks for any help that you can give.

Tim

Share this post


Link to post
Share on other sites



you could use FileFindFirstFile

then in a loop use FileFindNextFile

or you could do _FileListToArray

And loop through the array like

$file=_filelisttoarray(yourpath)

For $a=1 to Ubound($file)-1

do stuff with $file[$a]

Next


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

you could use FileFindFirstFile

then in a loop use FileFindNextFile

or you could do _FileListToArray

And loop through the array like

$file=_filelisttoarray(yourpath)

For $a=1 to Ubound($file)-1

do stuff with $file[$a]

Next

Thanks for your reply. Can you give me more specifics to my situation? Would I modify my existing script this way?

Any specific examples would be most helpful to me!

Thanks again!

Share this post


Link to post
Share on other sites

Any specific examples would be most helpful to me!

Look in the help file at FileFindFirstFile(), FileFindNextFile(), and the example scripts underneath each. For a different method, if you can work with arrays, look up _FileListToArray() in the help file and the example script under that.

:blink:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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