Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Need some help with a windows 7 issue


  • Please log in to reply
18 replies to this topic
joey3002
  • Members
  • 36 posts
  • Last active: Sep 30 2010 12:23 PM
  • Joined: 18 Mar 2010
This script worked fine on XP. Now that Im on windows 7, it wont work at all.

Basically, you select a few files in your explorer window, hit CTRL-J and it copies all the filenames to your clipboard where you can CTRL-V them into any document you want..

Its not putting the names into the clipboard.

^j::
  WinGetClass explorerClass, A
  ControlGetText currentPath, Edit1, ahk_class %explorerClass%
;  msgbox >%currentPath%<
  ControlGet, selectedFiles, List, Selected Col1, SysListView321,ahk_class %explorerClass%
  msgbox %selectedFiles%
  Loop, Parse, selectedFiles, `n  ; Rows are delimited by linefeeds (`n).
  {
clipboard = %selectedFiles%
}
return

Thanks in advance for any help..

joey3002
  • Members
  • 36 posts
  • Last active: Sep 30 2010 12:23 PM
  • Joined: 18 Mar 2010
no one can help me with this? please...

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
1. You are impatient, 3 hours is not a long time

2. Have you used Window Spy to get the class & control information for Explorer under Win 7 ?

3. If you have the control names right, you don't need "Wingetclass" ; just use :arrow: A

4. the parse loop is worst than useless in this example because you are assiging the SAME information to the clipboard each time through the loop

>>it copies all the filenames to your clipboard where you can CTRL-V them into any document you want..
5. the `n only is insufficient for notepad.

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Edit1 on Windows 7 doesn't contain the path of the current folder unless it (Edit1) is actually visible; i.e. the address bar has the focus. You could search the forums for a COM script to retrieve the path, or automate a right-click on the address bar. (IIRC, the right-click menu contains something like "Copy path as text".)

joey3002
  • Members
  • 36 posts
  • Last active: Sep 30 2010 12:23 PM
  • Joined: 18 Mar 2010
here is the spy info:

>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
F:\Custom Scripts
ahk_class CabinetWClass

>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen:    1225, 289  (less often used)
In Active Window:    1201, 66

>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<

Color:    0x87CEF0  (Blue=87 Green=CE Red=F0)

>>>>>>>>>>( Active Window Position )<<<<<<<<<<
left: 24     top: 223     width: 1050     height: 656

>>>>>>>>>>>( Status Bar Text )<<<<<<<<<<
(1): 

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
Address: F:\Custom Scripts
F:\Custom Scripts
Namespace Tree Control
Tree View
ShellView

>>>>>>>>>>>( Hidden Window Text )<<<<<<<<<<<
Shell Preview Extension Host
Namespace Tree Control

>>>>( TitleMatchMode=slow Visible Text )<<<<

>>>>( TitleMatchMode=slow Hidden Text )<<<<

I updated the script:
^j::
  WinGetClass CabinetWClass, A
  ControlGetText currentPath, Edit1, ahk_class %CabinetWClass%
  msgbox >%currentPath%<
  ControlGet, selectedFiles, List, Selected Col1, SysListView321,ahk_class %CabinetWClass%
  msgbox %selectedFiles%
  Loop, Parse, selectedFiles, `n  ; Rows are delimited by linefeeds (`n).
  {
clipboard = %selectedFiles%
}
return

It now gets the path but the main function of the filenames is not working. Thanks again for your help

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

here is the spy info:

It now gets the path but the main function of the filenames is not working. Thanks again for your help

You didn't post wndow spy information on the control that holds the filenames. :roll:

joey3002
  • Members
  • 36 posts
  • Last active: Sep 30 2010 12:23 PM
  • Joined: 18 Mar 2010
sorry.. was on vacation..

here is the requested info:

>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
C:\Users\myusername\Desktop\test
ahk_class CabinetWClass

>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen:	1309, 323  (less often used)
In Active Window:	1081, 172

>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<

Color:	0xF0F0F0  (Blue=F0 Green=F0 Red=F0)

>>>>>>>>>>( Active Window Position )<<<<<<<<<<
left: 228     top: 151     width: 1050     height: 656

>>>>>>>>>>>( Status Bar Text )<<<<<<<<<<
(1): 

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
Address: C:\Users\myusername\Desktop\test
C:\Users\myusername\Desktop\test
Namespace Tree Control
Tree View
ShellView

>>>>>>>>>>>( Hidden Window Text )<<<<<<<<<<<
Shell Preview Extension Host
Namespace Tree Control

>>>>( TitleMatchMode=slow Visible Text )<<<<

>>>>( TitleMatchMode=slow Hidden Text )<<<<



joey3002
  • Members
  • 36 posts
  • Last active: Sep 30 2010 12:23 PM
  • Joined: 18 Mar 2010
was that the info you needed from me?

thanks

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

here is the spy info:

...
...
I updated the script:
...
...
It now gets the path but the main function of the filenames is not working. Thanks again for your help


Please post the results from the two msgbox (you can copy the information while one is displayed by hitting control-c -- and paste the clipboard into a temporary notepad file.)

Your script gets the data from the Edit1 control (address box I believe) and then >>does nothing with it<<. What do you want it for?

Please show a example of what format you want the data in.

joey3002
  • Members
  • 36 posts
  • Last active: Sep 30 2010 12:23 PM
  • Joined: 18 Mar 2010
those boxes were for error checking... basically, i just want to highlight 4-7 files when in windows explorer and then hit CTRL-J and have it copy the filenames to the clipboard so i can then do ctrl-v to paste them into a document.

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
joey3002,

I really want to help. But since I don't have Win7 I have to reply on your answers.

Unfortunately, you don't answer the questions I ask.

If you would like my help, please review my prior post and provide the answers I requested.

joey3002
  • Members
  • 36 posts
  • Last active: Sep 30 2010 12:23 PM
  • Joined: 18 Mar 2010
sorry.. and I really do appreciate your help.

the first msg box just does > <

the 2nd is blank

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

Please show a example of what format you want the data in.


In other words, you tried to get the address value from the edit1 control
and you tried to get the 'selected' file list from the other control.

How do you want the data placed on the clipboard (and therefore into your application) ?

Sorry if it seems like I'm trying to be a pain.

joey3002
  • Members
  • 36 posts
  • Last active: Sep 30 2010 12:23 PM
  • Joined: 18 Mar 2010

Please show a example of what format you want the data in.


In other words, you tried to get the address value from the edit1 control
and you tried to get the 'selected' file list from the other control.

How do you want the data placed on the clipboard (and therefore into your application) ?

Sorry if it seems like I'm trying to be a pain.


not being a pain, I just really appreciate the help.

As for the clipboard, I am not sure what you mean, in the xp version (the one I pasted) when I hit CTRL-J it did its thing and then put all the selected filenames into the clipboard so that I could paste them into anything I wanted..

hope I answered the question :)

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

I updated the script:

However, you seem to have missed Leef_me's suggestions and my point:

Edit1 on Windows 7 doesn't contain the path of the current folder unless it (Edit1) is actually visible; i.e. the address bar has the focus.

(Well, I later remembered that it updates when you give it focus, so it doesn't technically need to be visible, just needs to have had focus since you navigated to that folder.) Maybe this will help to clarify:

Posted Image

This works for me:
^j::
    Send ^c!d
    ControlGetText currentPath, Edit1, A
    MsgBox % currentPath "`n" Clipboard
return
Reliability can be improved, though:
^j::
    Clipboard := ""         ; Empty clipboard.
    Send ^c!d               ; Send Ctrl+C (copy) and Alt+D (focus address bar)
    ClipWait 1              ; Wait for clipboard to contain something.
    Clipboard := Clipboard  ; Convert to text.
    ControlGetText currentPath, Edit1, A    ; Retrieve address (only works after Alt+D).
    MsgBox % currentPath "`n" Clipboard     ; Show address and list of selected files.
return