Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

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


  • Please log in to reply
4 replies to this topic

#1 nimany

nimany

    Seeker

  • Normal Members
  • 3 posts

Posted 03 August 2012 - 03:08 PM

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}")








#2 GMK

GMK

  • Active Members
  • PipPipPipPipPipPip
  • 374 posts

Posted 03 August 2012 - 08:38 PM

Have you tried ControlSetText?

#3 JLogan3o13

JLogan3o13

    115 and holding

  • MVPs
  • 4,327 posts

Posted 03 August 2012 - 08:48 PM

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

If you put a million monkeys on a million keyboards, one of them will eventually write a Java program. The rest of them will write Perl programs.

 

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


#4 nimany

nimany

    Seeker

  • Normal Members
  • 3 posts

Posted 06 August 2012 - 09:07 AM

Have you tried ControlSetText?

It's awesome, thanks dear GMK :)

#5 nimany

nimany

    Seeker

  • Normal Members
  • 3 posts

Posted 06 August 2012 - 09:11 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users