nimany Posted August 3, 2012 Posted August 3, 2012 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}")
Moderators JLogan3o13 Posted August 3, 2012 Moderators Posted August 3, 2012 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 "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!
nimany Posted August 6, 2012 Author Posted August 6, 2012 Have you tried ControlSetText?It's awesome, thanks dear GMK
nimany Posted August 6, 2012 Author Posted August 6, 2012 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now