Sign in to follow this  
Followers 0

how to send a long string to open dialog of a program using AutoIt v3

5 posts in this topic

#1 ·  Posted

I need to send a long string of input names to open dialog of a program. I've tried send() function but it can't do this completely. I think because of OS context switch send() function sends some part of the string to another program.

following code is some part of my script:

$ftmp = ""
while 1
  $fname = FileReadLine($file)
  if @error = -1 then ExitLoop
  $ftmp = $ftmp & $fname & " "
WEnd 
send("^o")
WinActivate("Open Image")
sleep(100)
send($fadrs)
Sleep(200)
send("{ENTER}")
sleep(10)
send($ftmp)
Sleep(100)
send("{ENTER}")

Share this post


Link to post
Share on other sites



#2 ·  Posted

Have you tried ControlSetText?

Share this post


Link to post
Share on other sites

#3 ·  Posted

Hi, nimany, welcome to the forum. You could always read the entire file into an Array, and then parse it out. This should also be much faster the a bunch of FileReadLines. The example below should get you started down the road :)

#include <file.au3>
#include <Array.au3>

$file = @DesktopDir & "Test.txt"
Local $aArray

_FileReadToArray($file, $aArray)

For $element in $aArray
  ConsoleWrite($element & " " & $file)
Next

Dealing with end users: "Every day I play hide-and-seek with Stupid. Usually it finds me."

My Scripts: SCCM UDFInclude Source with Compiled Script, Disk Maintenance for Windows XP, "Deal-A-Day" Sites, Windows Firewall UDF

Share this post


Link to post
Share on other sites

#4 ·  Posted

Have you tried ControlSetText?

It's awesome, thanks dear GMK :)

Share this post


Link to post
Share on other sites

#5 ·  Posted

Hi, nimany, welcome to the forum. You could always read the entire file into an Array, and then parse it out. This should also be much faster the a bunch of FileReadLines. The example below should get you started down the road :)

#include <file.au3>
#include <Array.au3>

$file = @DesktopDir & "Test.txt"
Local $aArray

_FileReadToArray($file, $aArray)

For $element in $aArray
ConsoleWrite($element & " " & $file)
Next

Thank you dear jlogan3o13 for answering

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