Sign in to follow this  
Followers 0
AutoitMike

Cold windows

6 posts in this topic

#1 ·  Posted (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 by AutoitMike

Share this post


Link to post
Share on other sites



This looks fantastic, I think it will work. I am inserting this into my code now.

I will let you know..........

Share this post


Link to post
Share on other sites

Where did you find "_FileListToArray" ?

This works great !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by JoHanatCent

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