|
Contro
|
 |
« on: June 26, 2012, 04:40:16 PM » |
|
Capture the address window or file path to the clipboard with hotkey I would like a software for 1. Capture the address of the selected active window to the clipboard with a definable hotkey 2. capture the file path selected to the clipboard with a definable hotkey   Best Regards
|
|
|
|
|
Logged
|
|
|
|
|
skwire
|
 |
« Reply #1 on: June 26, 2012, 05:39:14 PM » |
|
1. Capture the address of the selected active window to the clipboard with a definable hotkey Since you have the active path displayed in the window's titlebar, you can do your first request like this: Formatted for Autohotkey with the GeSHI Syntax Highlighter [ copy or print] #q:: ; Win+Q, change to your liking. { }
2. capture the file path selected to the clipboard with a definable hotkey The easiest way is probably: Formatted for Autohotkey with the GeSHI Syntax Highlighter [ copy or print] #c:: ; Win+C, change to your liking. { }
|
|
|
|
|
Logged
|
|
|
|
|
Contro
|
 |
« Reply #2 on: June 26, 2012, 08:25:53 PM » |
|
1. Capture the address of the selected active window to the clipboard with a definable hotkey Since you have the active path displayed in the window's titlebar, you can do your first request like this: Formatted for Autohotkey with the GeSHI Syntax Highlighter [ copy or print] #q:: ; Win+Q, change to your liking. { }
2. capture the file path selected to the clipboard with a definable hotkey The easiest way is probably: Formatted for Autohotkey with the GeSHI Syntax Highlighter [ copy or print] #c:: ; Win+C, change to your liking. { }
Running I can't believe would be so simpleeeeeeeeeeeeeee 
|
|
|
|
|
Logged
|
|
|
|
|
|
Contro
|
 |
« Reply #3 on: June 26, 2012, 08:44:30 PM » |
|
i am trying this first. But no results [ copy or print] ; 1. Capture the address of the selected active window to the clipboard with a definable hotkey ; Since you have the active path displayed in the window's titlebar, you can do your first request like this: ; Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print] ; Skwire ; !#y:: ; no parece elegible ^#y en ctrl+Win+y, change to your liking. Pruebo con alt ^!u:: ; { WinGetTitle, Clipboard, A } Return In the screenshots I selected the folder path, but the target is copy to the clipboard without it. Only needed to select the windows folder. I am doing something bad. Don't copy I tried also win+1 but the clipboard have wrong. It seems don't act the command
|
|
|
|
« Last Edit: June 26, 2012, 08:52:21 PM by Contro »
|
Logged
|
|
|
|
|
Contro
|
 |
« Reply #4 on: June 27, 2012, 09:21:35 PM » |
|
Repeating [ copy or print] #q:: ; Win+Q, change to your liking. { WinGetTitle, Clipboard, A } Return Go perfect
|
|
|
|
|
Logged
|
|
|
|
|
Contro
|
 |
« Reply #5 on: June 27, 2012, 09:33:44 PM » |
|
Repeating [ copy or print] #c:: ; Win+C, change to your liking. { Clipboard = %Clipboard% } Return don't go I don't understand clipboard = %clipboard% ; Convert any copied files, HTML, or other formatted text to plain text. I position the cursor over one file. By example :  After applying the script don't appear the clip in my Ditto Clipboard.
|
|
|
|
|
Logged
|
|
|
|
|
skwire
|
 |
« Reply #6 on: June 27, 2012, 09:54:02 PM » |
|
Try this: Formatted for Autohotkey with the GeSHI Syntax Highlighter [ copy or print] #c:: ; Win+C, change to your liking. { }
|
|
|
|
|
Logged
|
|
|
|
|
4wd
|
 |
« Reply #7 on: June 27, 2012, 10:39:09 PM » |
|
I'm not sure but I think what Contro is saying is: a) If no file is selected, return the Window address field to the clipboard. b) If a file is selected, return the full path of the file. Feel free to ignore me if I'm wrong  Of course, with my non-knowledge of AutoHK you might have already answered the question, in which case feel free to 
|
|
|
|
|
Logged
|
Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum 
|
|
|
|
Contro
|
 |
« Reply #8 on: June 28, 2012, 06:14:15 AM » |
|
I'm not sure but I think what Contro is saying is: a) If no file is selected, return the Window address field to the clipboard. b) If a file is selected, return the full path of the file. Feel free to ignore me if I'm wrong  Of course, with my non-knowledge of AutoHK you might have already answered the question, in which case feel free to  May be that what you are telling is what I must say.  It's a good solution, because with one hotkey we can do all the tasks
|
|
|
|
|
Logged
|
|
|
|
|
Contro
|
 |
« Reply #9 on: June 28, 2012, 06:14:43 AM » |
|
Try this: Formatted for Autohotkey with the GeSHI Syntax Highlighter [ copy or print] #c:: ; Win+C, change to your liking. { }
Running to try Best Regards 
|
|
|
|
|
Logged
|
|
|
|
|
Contro
|
 |
« Reply #10 on: June 28, 2012, 06:21:10 AM » |
|
A Strange thing. One time goes well. next time fails. 4wd is the best initial idea : Possibilities with the assigned hotkey . 1. In the active window assigned hotkey copy the active window path to the clipboard 2. In the active window and one subfolder select copy the the subfolder path to the clipboard 3. In the active window and file select inside that folder or explorer window copy the file path to the clipboard. 
|
|
|
|
|
Logged
|
|
|
|
|
4wd
|
 |
« Reply #11 on: July 03, 2012, 09:21:28 AM » |
|
I did not write any of this, (except _ExClip function and set a hotkey), it was written by Ascend4ant and Melba23 over on the AutoIt forum. Thank them if you want to thank someone. The hotkey is set for Shift+Alt+C, edit the code to change it to what you like. - If nothing is selected, the Explorer path is clipped.
- If something is selected, its full path is clipped.
- If multiple somethings are selected, only the first one is returned.
Formatted for AutoIt with the GeSHI Syntax Highlighter [ copy or print] ; http://www.autoitscript.com/forum/topic/89833-windows-explorer-current-folder/page__st__40#entry973904 #include <Array.au3> $hExplr = WinActive("[REGEXPCLASS:(Explore|Cabinet)WClass]") $aSelection = _ExplorerWinGetSelectedItems($hExplr) ; ========================================================================================================================== ; Func _ObjectSHFolderViewFromWin($hWnd) ; ; Returns an 'ShellFolderView' Object for the given Window handle ; ; Author: Ascend4nt, based on code by KaFu, klaus.s ; ========================================================================================================================== Func _ObjectSHFolderViewFromWin ($hWnd) Local $oShell,$oShellWindows,$oIEObject,$oSHFolderView ; Shell Object ; Get a 'ShellWindows Collection' object $oShellWindows = $oShell.Windows() ; Iterate through the collection - each of type 'InternetExplorer' Object For $oIEObject In $oShellWindows ; InternetExplorer->Document = ShellFolderView object $oSHFolderView=$oIEObject.Document ; ========================================================================================================================== ; Func _ExplorerWinGetSelectedItems($hWnd) ; ; ; Author: klaus.s, KaFu, Ascend4nt (consolidation & cleanup, Path name simplification) ; ========================================================================================================================== Func _ExplorerWinGetSelectedItems ($hWnd) Local $iSelectedItems,$iCounter=2,$aSelectedItems[2] = [0, ""] $oSHFolderView=_ObjectSHFolderViewFromWin($hWnd) ; SelectedItems = FolderItems Collection object->Count $iSelectedItems = $oSHFolderView.SelectedItems.Count Dim $aSelectedItems[$iSelectedItems+2] ; 2 extra -> 1 for count [0], 1 for Folder Path [1] $aSelectedItems[0]=$iSelectedItems ; ShellFolderView->Folder->Self as 'FolderItem'->Path $aSelectedItems[1]=$oSHFolderView.Folder.Self.Path ; ShellFolderView->SelectedItems = FolderItems Collection object $oSelectedFolderItems = $oSHFolderView.SelectedItems #cs ; For ALL items in an Explorer Window (not just the selected ones): $oSelectedFolderItems = $oSHFolderView.Folder.Items ReDim $aSelectedItems[$oSelectedFolderItems.Count+2] #ce For $oFolderItem In $oSelectedFolderItems $aSelectedItems[$iCounter] = $oFolderItem.Path $iCounter += 1 EndFunc ;==>_ExplorerWinGetSelectedItems Func _ComErrFunc ($oError) "Windescription:" & @TAB & $oError.windescription & @CRLF & _ "Description is: " & @TAB & $oError.description & @CRLF & _ "Source is: " & @TAB & $oError.source & @CRLF & _ "Helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "Helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "Lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "Scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
|
|
|
|
« Last Edit: July 03, 2012, 09:30:53 AM by 4wd; Reason: For some reason I appear to be getting grumpier...it\'s not true...honest...maybe it\'s just the way I phrase things...or maybe I haven\'t had enough coffee... »
|
Logged
|
Four wheel drive: Helping you get stuck faster, harder, further from help...........and it's no different on this forum 
|
|
|
|
Contro
|
 |
« Reply #12 on: July 03, 2012, 11:01:44 AM » |
|
I did not write any of this, (except _ExClip function and set a hotkey), it was written by Ascend4ant and Melba23 over on the AutoIt forum. Thank them if you want to thank someone. The hotkey is set for Shift+Alt+C, edit the code to change it to what you like. - If nothing is selected, the Explorer path is clipped.
- If something is selected, its full path is clipped.
- If multiple somethings are selected, only the first one is returned.
Formatted for AutoIt with the GeSHI Syntax Highlighter [ copy or print] ; http://www.autoitscript.com/forum/topic/89833-windows-explorer-current-folder/page__st__40#entry973904 #include <Array.au3> $hExplr = WinActive("[REGEXPCLASS:(Explore|Cabinet)WClass]") $aSelection = _ExplorerWinGetSelectedItems($hExplr) ; ========================================================================================================================== ; Func _ObjectSHFolderViewFromWin($hWnd) ; ; Returns an 'ShellFolderView' Object for the given Window handle ; ; Author: Ascend4nt, based on code by KaFu, klaus.s ; ========================================================================================================================== Func _ObjectSHFolderViewFromWin ($hWnd) Local $oShell,$oShellWindows,$oIEObject,$oSHFolderView ; Shell Object ; Get a 'ShellWindows Collection' object $oShellWindows = $oShell.Windows() ; Iterate through the collection - each of type 'InternetExplorer' Object For $oIEObject In $oShellWindows ; InternetExplorer->Document = ShellFolderView object $oSHFolderView=$oIEObject.Document ; ========================================================================================================================== ; Func _ExplorerWinGetSelectedItems($hWnd) ; ; ; Author: klaus.s, KaFu, Ascend4nt (consolidation & cleanup, Path name simplification) ; ========================================================================================================================== Func _ExplorerWinGetSelectedItems ($hWnd) Local $iSelectedItems,$iCounter=2,$aSelectedItems[2] = [0, ""] $oSHFolderView=_ObjectSHFolderViewFromWin($hWnd) ; SelectedItems = FolderItems Collection object->Count $iSelectedItems = $oSHFolderView.SelectedItems.Count Dim $aSelectedItems[$iSelectedItems+2] ; 2 extra -> 1 for count [0], 1 for Folder Path [1] $aSelectedItems[0]=$iSelectedItems ; ShellFolderView->Folder->Self as 'FolderItem'->Path $aSelectedItems[1]=$oSHFolderView.Folder.Self.Path ; ShellFolderView->SelectedItems = FolderItems Collection object $oSelectedFolderItems = $oSHFolderView.SelectedItems #cs ; For ALL items in an Explorer Window (not just the selected ones): $oSelectedFolderItems = $oSHFolderView.Folder.Items ReDim $aSelectedItems[$oSelectedFolderItems.Count+2] #ce For $oFolderItem In $oSelectedFolderItems $aSelectedItems[$iCounter] = $oFolderItem.Path $iCounter += 1 EndFunc ;==>_ExplorerWinGetSelectedItems Func _ComErrFunc ($oError) "Windescription:" & @TAB & $oError.windescription & @CRLF & _ "Description is: " & @TAB & $oError.description & @CRLF & _ "Source is: " & @TAB & $oError.source & @CRLF & _ "Helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "Helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _ "Lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "Scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
I'll try and comment. 
|
|
|
|
|
Logged
|
|
|
|
|
Contro
|
 |
« Reply #13 on: July 03, 2012, 12:09:29 PM » |
|
|
|
|
|
|
Logged
|
|
|
|
|
gabrielko
|
 |
« Reply #14 on: October 02, 2012, 11:41:06 AM » |
|
This may or may not be significant, it's totally up to you to decide I really did get a quick fix with Long Path Tool. http://PathTooDeep.com 
|
|
|
|
|
Logged
|
|
|
|
|