WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: mcjathan on February 19, 2014, 02:19:03 PM

Title: Clipboard Tricks Hotkey?
Post by: mcjathan on February 19, 2014, 02:19:03 PM
Greetings,

We've come to rely a lot on Winbatch's Clipboard Tricks installation in the context menu.  We're wondering if we can create a hotkey for the Path and Filename(s) function.  We already have a hotkey utility that we use to create other customized hotkeys.  Is there a way we can select the file and then run FileMenu.DLL using our hotkey utility and then have the selected file's Path and Filename pasted to the clipboard?  If so, please provide an example.

Regards,

Jeff
Title: Re: Clipboard Tricks Hotkey?
Post by: Deana on February 19, 2014, 03:03:13 PM
Your script might look something like this:

Code (winbatch) Select

;TOTALLY UNDEBUGGED
explorers = IntControl(31,1,0,0,0)
count = ItemCount( explorers, @tab )
For x = 1 to Count
   winid = ItemExtract( x, explorers, @tab )
   hwnd = DllHwnd( winid )
   ;Pause("Window handle of Explorer",cWndInfo(hwnd,0))
   objShell = CreateObject("Shell.Application")
   objInstances = objShell.windows
   If objInstances.Count > 0 ; make sure we have instances open.
    ForEach objWindow In objInstances
        If objWindow.hwnd == hwnd
  Colselected = objWindow.document.SelectedItems
  ForEach objSel In Colselected
     Pause('Selected Item',objSel.Path)
  Next
  Endif
    Next
   EndIf
Next
Exit
Title: Re: Clipboard Tricks Hotkey?
Post by: mcjathan on February 20, 2014, 12:33:06 PM
Beautiful!  That did the trick!  Thank you.
Title: Re: Clipboard Tricks Hotkey?
Post by: Deana on February 20, 2014, 01:11:21 PM
Posted some revised code into the tech database. Check it out: http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/tsleft.web+WinBatch/FileMenu~and~PopMenu/FileMenu+Clipboard~Tricks.txt