AutoitMike Posted February 12, 2011 Share Posted February 12, 2011 (edited) It seems that when a window is "Cold", that is, it has not had the focus for a long time, keystrokes (Send function) do not play properly. I have code that copies the names of 2 , maybe 3 files from a "My Computer" explorer window and puts them into an array. This is the window you get by clicking on "My Computor, rather than "Windows explorer") If Not WinActivate("folder name") Then MsgBox(0,'',"Proper window is not open, Exiting") Exit EndIf Sleep(500) ;Let the window have time to come fully alive, however, it does not help Dim $FL[10] ;FC is file count, previously calculated (which is an array) Send("{home}") ;This highlights the first file (In details view) ;put all file names into array For $I = 1 to $FC[1] Send("!fm") ;Rename command, this makes the currently highlighted file name editable (and copy-able to clip board) Send("^c") ;copy to clipboard Send("{enter}{down}") ;Press enter without making any changes and move down to the next file name $FL[$I]=ClipGet() ;put the file name into the array Next What I end up with is 1, 2 or 3 of the elements in the array $FL that was already in the clipboard from an other application. It Always works correctly the second time in succession. Any ideas anyone?? Thanks Edited February 12, 2011 by AutoitMike Link to comment Share on other sites More sharing options...
JoHanatCent Posted February 12, 2011 Share Posted February 12, 2011 Any ideas anyone?? Thanks Can not help with your forgetting clipboard BUT may I ask why do you not try this: #include <File.au3> #include <Array.au3> $FileList = _FileListToArray(@ScriptDir, "*.txt", 1) _ArrayDisplay($FileList, "$FileList") Link to comment Share on other sites More sharing options...
AutoitMike Posted February 15, 2011 Author Share Posted February 15, 2011 This looks fantastic, I think it will work. I am inserting this into my code now. I will let you know.......... Link to comment Share on other sites More sharing options...
AutoitMike Posted February 15, 2011 Author Share Posted February 15, 2011 Where did you find "_FileListToArray" ? This works great !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Link to comment Share on other sites More sharing options...
somdcomputerguy Posted February 15, 2011 Share Posted February 15, 2011 Where did you find "_FileListToArray" ?It's in the Helpfile. User Defined Functions Reference|File Management. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
JoHanatCent Posted February 15, 2011 Share Posted February 15, 2011 (edited) Try: $sAutoItPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") Run(@WindowsDir & "\HH.exe " & $sAutoItPath & "\UDFs3.chm::/html/libfunctions/_FileListToArray.htm", "", @SW_MAXIMIZE) Edited February 15, 2011 by JoHanatCent Link to comment Share on other sites More sharing options...
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