working with clipboard

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
zloidooraque
Junior Member
Junior Member
Posts: 19
Joined: 2014-06-23, 08:32 UTC

working with clipboard

Post by *zloidooraque »

say, i have some path in clipboard
now, to navigate to this path i type in command line "cd " quote, press ctrl+v, quote
or to copy, same, but "copy "

i want to bind it to hotkey, but it seems there is no way.
am i right?

i wonder how in ten years there is yet no possibility to do that.
for user commands, parameters might be like target path, destination path and so on, but not clipboard content.. i'm so pissed off
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Atleast for the "CD" command you could use NirCmd.

Create a button or command with:

Code: Select all

 c:\PathTo\nircmd.exe exec show %COMMANDER_EXE% /O "~$clipboard$"
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Good idea ;-)

UserCmd.ini

Code: Select all

[em_CDToClip]
cmd=%Commander_Path%\plugins\NirSoft\nircmd.exe exec show %COMMANDER_EXE% /O /S /L="~$clipboard$"
Then
Configuration > Misc > assign shortcut (like Ctrl+Shift+C) to em_CDToClip


- - -

More to "/O /S /L=" at the help:
4. Configuration and switches
a. Command line parameters

.
zloidooraque
Junior Member
Junior Member
Posts: 19
Joined: 2014-06-23, 08:32 UTC

Post by *zloidooraque »

if only nircmd could strip clipboard from spaces and quotes now! (=

but thanks, it's something at least
User avatar
Stefan2
Power Member
Power Member
Posts: 4281
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

zloidooraque wrote:if only nircmd could strip clipboard from spaces and quotes now! (=
Then use a script in instead:

[em_CDToClip]
cmd=myScript.vbs


myScript.vbs (pseudo code)
myVar = oIE.getClipboard
myVar = replace(myVar , qoute ,"")
myVar = replace(myVar , space, "")
WSC.run "%COMMANDER_EXE% /O /S /L="myVar"


- - -

But make this really sense?
"C:\Windows\Downloaded Program Files"
C:\Windows\DownloadedProgramFiles


- - -

Here is such script.
Save as *.vbs

.

Code: Select all

'// Test
    strText = """  C:\Windows\Downloaded Program Files  """
'//Get Clipboard
    Set oIE=CreateObject("InternetExplorer.Application")
    oIE.navigate "about:blank" : Do While oIE.ReadyState<>4 : WScript.sleep 50 : Loop
    strCLIP = oIE.document.ParentWindow.ClipboardData.getdata("text")
    oIE.Quit
'//clean-up
    strCLIP = replace(strCLIP, chr(34), "")
    strCLIP = trim(strCLIP)
'//Debug
    MsgBox "<"& strText &">" & vbCRLF & vbCRLF & "<"& strCLIP &">"
'//execute command to TC (due to the env var, run this script from inside of TC!!!)
    Set WSC = CreateObject("WScript.Shell")
    WSC.run "%COMMANDER_EXE% /O /S /L=" & chr(34) & strCLIP & chr(34)
zloidooraque
Junior Member
Junior Member
Posts: 19
Joined: 2014-06-23, 08:32 UTC

Post by *zloidooraque »

big thanks!

by "strip spaces" i mean just at beginning and the end of string of course

i'm c++/c# programmer myself but VB is driving me mad badly every time i see it or need to write something in it lol. as objective-c does..
Post Reply