tommytx Posted March 10, 2009 Posted March 10, 2009 Please help with the following question.. Everything works fine with exception of the data in the asterisks below. What I am trying to do is simply grab the name of each file as it comes in and I need the file in a variable so I can do a Send command with it. But any way that I try to grab the variable from $file it end up with an error. What syntax do i need to get each incoming file name from $file into a regular variable so I can use it like so: Send($myvariable) $mydir = "C:\autoit_work_folder\ewi\" FileChangeDir($mydir) ; Shows the filenames of all files in the current directory. $search = FileFindFirstFile("*.txt") While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File Name:", $file) ; ******************************* $myfile = (4096, "File Name:", $file) MsgBox($myfile) ; ******************************* WEnd FileClose($search)
EndFunc Posted March 10, 2009 Posted March 10, 2009 (edited) Please help with the following question.. Everything works fine with exception of the data in the asterisks below. What I am trying to do is simply grab the name of each file as it comes in and I need the file in a variable so I can do a Send command with it. But any way that I try to grab the variable from $file it end up with an error. What syntax do i need to get each incoming file name from $file into a regular variable so I can use it like so: Send($myvariable) $mydir = "C:\autoit_work_folder\ewi\" FileChangeDir($mydir) ; Shows the filenames of all files in the current directory. $search = FileFindFirstFile("*.txt") While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File Name:", $file) ; ******************************* $myfile = (4096, "File Name:", $file) MsgBox($myfile) ; ******************************* WEnd FileClose($search) Im confused at what your are trying to do, but try declaring another var equal to $file. $mydir = "C:\autoit_work_folder\ewi\" FileChangeDir($mydir) ; Shows the filenames of all files in the current directory. $search = FileFindFirstFile("*.txt") While 1 $file = FileFindNextFile($search) If @error Then ExitLoop ;MsgBox(4096, "File Name:", $file) ; ******************************* $myfile = $file MsgBox(0, "test", $myfile) ; ******************************* WEnd FileClose($search) Edit: changed the dir back to your test dir. Edited March 10, 2009 by EndFunc EndFuncAutoIt is the shiznit. I love it.
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